1
0

files-external-webdav.yml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. name: PHPUnit files_external WebDAV
  2. on:
  3. pull_request:
  4. schedule:
  5. - cron: "5 2 * * *"
  6. concurrency:
  7. group: files-external-webdav-${{ 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. - '**.php'
  29. files-external-webdav-apache:
  30. runs-on: ubuntu-latest
  31. needs: changes
  32. if: ${{ github.repository_owner != 'nextcloud-gmbh' && needs.changes.outputs.src != 'false' }}
  33. strategy:
  34. matrix:
  35. php-versions: ['8.1', '8.2', '8.3']
  36. include:
  37. - php-versions: '8.2'
  38. coverage: ${{ github.event_name != 'pull_request' }}
  39. name: php${{ matrix.php-versions }}-webdav
  40. services:
  41. apache:
  42. image: ghcr.io/nextcloud/continuous-integration-webdav-apache:latest
  43. ports:
  44. - 8081:80
  45. steps:
  46. - name: Checkout server
  47. uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
  48. with:
  49. submodules: true
  50. - name: Set up php ${{ matrix.php-versions }}
  51. uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
  52. with:
  53. php-version: ${{ matrix.php-versions }}
  54. # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
  55. 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
  56. coverage: ${{ matrix.coverage && 'xdebug' || 'none' }}
  57. ini-file: development
  58. env:
  59. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  60. - name: Set up Nextcloud
  61. run: |
  62. composer install
  63. ./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
  64. ./occ config:system:set --value true --type boolean allow_local_remote_servers
  65. ./occ app:enable --force files_external
  66. echo "<?php return ['run' => true, 'host' => 'localhost:8081/webdav/', 'user' => 'test', 'password'=>'pass', 'root' => '', 'wait' => 0];" > apps/files_external/tests/config.webdav.php
  67. - name: Wait for WebDAV
  68. run: |
  69. sleep 5
  70. curl -f -m 1 --retry-connrefused --retry 10 --retry-delay 10 http://test:pass@localhost:8081/webdav/
  71. - name: PHPUnit
  72. run: composer run test:files_external -- --verbose \
  73. apps/files_external/tests/Storage/WebdavTest.php \
  74. ${{ matrix.coverage && ' --coverage-clover ./clover.xml' || '' }}
  75. - name: Upload code coverage
  76. if: ${{ !cancelled() && matrix.coverage }}
  77. uses: codecov/codecov-action@c16abc29c95fcf9174b58eb7e1abf4c866893bc8 # v4.1.1
  78. with:
  79. files: ./clover.xml
  80. flags: phpunit-files-external-webdav
  81. files-external-webdav-summary:
  82. runs-on: ubuntu-latest-low
  83. needs: [changes, files-external-webdav-apache]
  84. if: always()
  85. steps:
  86. - name: Summary status
  87. run: if ${{ needs.changes.outputs.src != 'false' && needs.files-external-webdav-apache.result != 'success' }}; then exit 1; fi