integration-dav.yml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. # SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
  2. # SPDX-License-Identifier: MIT
  3. name: DAV integration tests
  4. on:
  5. pull_request:
  6. concurrency:
  7. group: integration-caldav-${{ 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. - '**/*.php'
  24. - '**/lib/**'
  25. - '**/tests/**'
  26. - '**/vendor-bin/**'
  27. - 'build/integration/**'
  28. - '.php-cs-fixer.dist.php'
  29. - 'composer.json'
  30. - 'composer.lock'
  31. integration-caldav:
  32. runs-on: ubuntu-latest
  33. needs: changes
  34. if: needs.changes.outputs.src != 'false' && github.repository_owner != 'nextcloud-gmbh'
  35. strategy:
  36. # do not stop on another job's failure
  37. fail-fast: false
  38. matrix:
  39. php-versions: ['8.3']
  40. endpoint: ['old', 'new']
  41. service: ['CalDAV', 'CardDAV']
  42. name: ${{ matrix.service }} (${{ matrix.endpoint }} endpoint) php${{ matrix.php-versions }}
  43. steps:
  44. - name: Checkout server
  45. uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
  46. with:
  47. submodules: true
  48. - name: Set up php ${{ matrix.php-versions }}
  49. uses: shivammathur/setup-php@2e947f1f6932d141d076ca441d0e1e881775e95b #v2.31.0
  50. with:
  51. php-version: ${{ matrix.php-versions }}
  52. # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
  53. 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
  54. coverage: 'none'
  55. ini-file: development
  56. env:
  57. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  58. - name: Set up Python
  59. uses: LizardByte/setup-python-action@master
  60. with:
  61. python-version: '2.7'
  62. - name: Set up CalDAVTester
  63. run: |
  64. git clone --depth=1 https://github.com/apple/ccs-caldavtester.git CalDAVTester
  65. git clone --depth=1 https://github.com/apple/ccs-pycalendar.git pycalendar
  66. - name: Set up Nextcloud
  67. run: |
  68. mkdir data
  69. ./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 admin
  70. # disable the trashbin, so recurrent deletion of the same object works
  71. ./occ config:app:set dav calendarRetentionObligation --value=0
  72. # Prepare users
  73. OC_PASS=user01 ./occ user:add --password-from-env user01
  74. OC_PASS=user02 ./occ user:add --password-from-env user02
  75. # Prepare calendars
  76. ./occ dav:create-calendar user01 calendar
  77. ./occ dav:create-calendar user01 shared
  78. ./occ dav:create-calendar user02 calendar
  79. # Prepare address books
  80. ./occ dav:create-addressbook user01 addressbook
  81. ./occ dav:create-addressbook user02 addressbook
  82. - name: Run Nextcloud
  83. run: |
  84. php -S localhost:8888 &
  85. - name: Run CalDAVTester
  86. run: |
  87. cp "apps/dav/tests/travis/caldavtest/serverinfo-${{ matrix.endpoint }}${{ matrix.endpoint == 'old' && (matrix.service == 'CardDAV' && '-carddav' || '-caldav') || '' }}-endpoint.xml" "apps/dav/tests/travis/caldavtest/serverinfo.xml"
  88. pushd CalDAVTester
  89. PYTHONPATH="../pycalendar/src" python testcaldav.py --print-details-onfail --basedir "../apps/dav/tests/travis/caldavtest" -o cdt.txt \
  90. "${{ matrix.service }}/current-user-principal.xml" \
  91. "${{ matrix.service }}/sync-report.xml" \
  92. ${{ matrix.endpoint == 'new' && format('{0}/sharing-{1}.xml', matrix.service, matrix.service == 'CalDAV' && 'calendars' || 'addressbooks') || ';' }}
  93. popd
  94. - name: Print Nextcloud logs
  95. if: always()
  96. run: |
  97. cat data/nextcloud.log
  98. caldav-integration-summary:
  99. permissions:
  100. contents: none
  101. runs-on: ubuntu-latest-low
  102. needs: [changes, integration-caldav]
  103. if: always()
  104. steps:
  105. - name: Summary status
  106. run: if ${{ needs.changes.outputs.src != 'false' && needs.integration-caldav.result != 'success' }}; then exit 1; fi