Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. # This workflow is provided via the organization template repository
  2. #
  3. # https://github.com/nextcloud/.github
  4. # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
  5. #
  6. # SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
  7. # SPDX-License-Identifier: MIT
  8. name: PHPUnit OCI
  9. on:
  10. pull_request:
  11. schedule:
  12. - cron: "5 2 * * *"
  13. permissions:
  14. contents: read
  15. concurrency:
  16. group: phpunit-oci-${{ github.head_ref || github.run_id }}
  17. cancel-in-progress: true
  18. jobs:
  19. changes:
  20. runs-on: ubuntu-latest-low
  21. outputs:
  22. src: ${{ steps.changes.outputs.src }}
  23. steps:
  24. - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
  25. id: changes
  26. continue-on-error: true
  27. with:
  28. filters: |
  29. src:
  30. - '.github/workflows/**'
  31. - '3rdparty/**'
  32. - '**/appinfo/**'
  33. - '**/lib/**'
  34. - '**/templates/**'
  35. - '**/tests/**'
  36. - 'vendor/**'
  37. - 'vendor-bin/**'
  38. - '.php-cs-fixer.dist.php'
  39. - 'composer.json'
  40. - 'composer.lock'
  41. - '**.php'
  42. phpunit-oci:
  43. runs-on: ubuntu-latest
  44. needs: changes
  45. if: needs.changes.outputs.src != 'false' && ${{ github.repository_owner != 'nextcloud-gmbh' }}
  46. strategy:
  47. matrix:
  48. oracle-versions: ['11']
  49. php-versions: ['8.1', '8.2', '8.3']
  50. include:
  51. - php-versions: '8.3'
  52. coverage: ${{ github.event_name != 'pull_request' }}
  53. name: Oracle ${{ matrix.oracle-versions }} (PHP ${{ matrix.php-versions }}) - database tests
  54. services:
  55. cache:
  56. image: ghcr.io/nextcloud/continuous-integration-redis:latest
  57. ports:
  58. - 6379:6379/tcp
  59. options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
  60. oracle:
  61. image: ghcr.io/gvenzl/oracle-xe:${{ matrix.oracle-versions }}
  62. # Provide passwords and other environment variables to container
  63. env:
  64. ORACLE_RANDOM_PASSWORD: true
  65. APP_USER: oc_autotest
  66. APP_USER_PASSWORD: nextcloud
  67. # Forward Oracle port
  68. ports:
  69. - 4444:1521/tcp
  70. # Provide healthcheck script options for startup
  71. options: >-
  72. --health-cmd healthcheck.sh
  73. --health-interval 10s
  74. --health-timeout 5s
  75. --health-retries 10
  76. steps:
  77. - name: Checkout server
  78. uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
  79. with:
  80. submodules: true
  81. - name: Set up php ${{ matrix.php-versions }}
  82. uses: shivammathur/setup-php@c665c7a15b5295c2488ac8a87af9cb806cd72198 # v2
  83. with:
  84. php-version: ${{ matrix.php-versions }}
  85. # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
  86. extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, redis, session, simplexml, xmlreader, xmlwriter, zip, zlib, oci8
  87. coverage: ${{ matrix.coverage && 'xdebug' || 'none' }}
  88. ini-file: development
  89. env:
  90. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  91. - name: Set up dependencies
  92. run: composer i
  93. - name: Set up Nextcloud
  94. env:
  95. DB_PORT: 4444
  96. run: |
  97. mkdir data
  98. cp tests/redis.config.php config/
  99. cp tests/preseed-config.php config/config.php
  100. ./occ maintenance:install --verbose --database=oci --database-name=XE --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=oc_autotest --database-pass=nextcloud --admin-user admin --admin-pass admin
  101. php -f tests/enable_all.php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
  102. - name: PHPUnit
  103. run: composer run test:db ${{ matrix.coverage && ' -- --coverage-clover ./clover.db.xml' || '' }}
  104. - name: Upload db code coverage
  105. if: ${{ !cancelled() && matrix.coverage }}
  106. uses: codecov/codecov-action@v4.1.1
  107. with:
  108. files: ./clover.db.xml
  109. flags: phpunit-oci
  110. - name: Run repair steps
  111. run: |
  112. ./occ maintenance:repair --include-expensive
  113. summary:
  114. permissions:
  115. contents: none
  116. runs-on: ubuntu-latest-low
  117. needs: [changes, phpunit-oci]
  118. if: always()
  119. name: phpunit-oci-summary
  120. steps:
  121. - name: Summary status
  122. run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-oci.result != 'success' }}; then exit 1; fi