files-external.yml 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. # SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
  2. # SPDX-License-Identifier: MIT
  3. name: PHPUnit files_external generic
  4. on:
  5. pull_request:
  6. schedule:
  7. - cron: "5 2 * * *"
  8. concurrency:
  9. group: files-external-generic-${{ 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. - 'apps/files_external/**'
  26. - 'vendor/**'
  27. - 'vendor-bin/**'
  28. - 'composer.json'
  29. - 'composer.lock'
  30. files-external-generic:
  31. runs-on: ubuntu-latest
  32. needs: changes
  33. if: ${{ github.repository_owner != 'nextcloud-gmbh' && needs.changes.outputs.src != 'false' }}
  34. strategy:
  35. matrix:
  36. php-versions: ['8.1', '8.2', '8.3', '8.4']
  37. include:
  38. - php-versions: '8.2'
  39. coverage: ${{ github.event_name != 'pull_request' }}
  40. name: php${{ matrix.php-versions }}-generic
  41. steps:
  42. - name: Checkout server
  43. uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
  44. with:
  45. submodules: true
  46. - name: Set up php ${{ matrix.php-versions }}
  47. uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 #v2.31.1
  48. with:
  49. php-version: ${{ matrix.php-versions }}
  50. # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
  51. 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
  52. coverage: ${{ matrix.coverage && 'xdebug' || 'none' }}
  53. ini-file: development
  54. env:
  55. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  56. - name: Set up Nextcloud
  57. env:
  58. OBJECT_STORE_KEY: nextcloud
  59. OBJECT_STORE_SECRET: bWluaW8tc2VjcmV0LWtleS1uZXh0Y2xvdWQ=
  60. run: |
  61. composer install
  62. ./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
  63. ./occ app:enable --force files_external
  64. - name: PHPUnit
  65. run: composer run test:files_external \
  66. ${{ matrix.coverage && ' --coverage-clover ./clover.xml' || '' }}
  67. - name: Upload code coverage
  68. if: ${{ !cancelled() && matrix.coverage }}
  69. uses: codecov/codecov-action@v4.6.0
  70. with:
  71. files: ./clover.xml
  72. flags: phpunit-files-external-generic
  73. files-external-summary:
  74. runs-on: ubuntu-latest-low
  75. needs: [changes, files-external-generic ]
  76. if: always()
  77. steps:
  78. - name: Summary status
  79. run: if ${{ needs.changes.outputs.src != 'false' && needs.files-external-generic.result != 'success' }}; then exit 1; fi