You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

phpunit-oci.yml 4.3KB

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