1
0

files-external-webdav.yml 3.8 KB

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