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.2KB

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