1
0

files-external.yml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. name: PHPUnit files_external generic
  2. on:
  3. pull_request:
  4. schedule:
  5. - cron: "5 2 * * *"
  6. concurrency:
  7. group: files-external-generic-${{ github.head_ref || github.run_id }}
  8. cancel-in-progress: true
  9. jobs:
  10. changes:
  11. runs-on: ubuntu-latest-low
  12. outputs:
  13. src: ${{ steps.changes.outputs.src}}
  14. steps:
  15. - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
  16. id: changes
  17. continue-on-error: true
  18. with:
  19. filters: |
  20. src:
  21. - '.github/workflows/**'
  22. - '3rdparty/**'
  23. - 'apps/files_external/**'
  24. - 'vendor/**'
  25. - 'vendor-bin/**'
  26. - 'composer.json'
  27. - 'composer.lock'
  28. files-external-generic:
  29. runs-on: ubuntu-latest
  30. needs: changes
  31. if: ${{ github.repository_owner != 'nextcloud-gmbh' && needs.changes.outputs.src != 'false' }}
  32. strategy:
  33. matrix:
  34. php-versions: ['8.1', '8.2', '8.3']
  35. include:
  36. - php-versions: '8.2'
  37. coverage: ${{ github.event_name != 'pull_request' }}
  38. name: php${{ matrix.php-versions }}-generic
  39. steps:
  40. - name: Checkout server
  41. uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
  42. with:
  43. submodules: true
  44. - name: Set up php ${{ matrix.php-versions }}
  45. uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
  46. with:
  47. php-version: ${{ matrix.php-versions }}
  48. # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
  49. extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, redis, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
  50. coverage: ${{ matrix.coverage && 'xdebug' || 'none' }}
  51. ini-file: development
  52. env:
  53. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  54. - name: Set up Nextcloud
  55. env:
  56. OBJECT_STORE_KEY: nextcloud
  57. OBJECT_STORE_SECRET: bWluaW8tc2VjcmV0LWtleS1uZXh0Y2xvdWQ=
  58. run: |
  59. composer install
  60. ./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password
  61. ./occ app:enable --force files_external
  62. - name: PHPUnit
  63. run: composer run test:files_external \
  64. ${{ matrix.coverage && ' --coverage-clover ./clover.xml' || '' }}
  65. - name: Upload code coverage
  66. if: ${{ !cancelled() && matrix.coverage }}
  67. uses: codecov/codecov-action@v4.1.1
  68. with:
  69. files: ./clover.xml
  70. flags: phpunit-files-external-generic
  71. files-external-summary:
  72. runs-on: ubuntu-latest-low
  73. needs: [changes, files-external-generic ]
  74. if: always()
  75. steps:
  76. - name: Summary status
  77. run: if ${{ needs.changes.outputs.src != 'false' && needs.files-external-generic.result != 'success' }}; then exit 1; fi