phpunit-memcached.yml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. # This workflow is provided via the organization template repository
  2. #
  3. # https://github.com/nextcloud/.github
  4. # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
  5. #
  6. # SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
  7. # SPDX-License-Identifier: MIT
  8. name: PHPUnit memcached
  9. on:
  10. pull_request:
  11. schedule:
  12. - cron: "5 2 * * *"
  13. permissions:
  14. contents: read
  15. concurrency:
  16. group: phpunit-memcached-${{ github.head_ref || github.run_id }}
  17. cancel-in-progress: true
  18. jobs:
  19. changes:
  20. runs-on: ubuntu-latest-low
  21. outputs:
  22. src: ${{ steps.changes.outputs.src}}
  23. steps:
  24. - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
  25. id: changes
  26. continue-on-error: true
  27. with:
  28. filters: |
  29. src:
  30. - '.github/workflows/**'
  31. - '3rdparty/**'
  32. - '**/appinfo/**'
  33. - '**/lib/**'
  34. - '**/templates/**'
  35. - '**/tests/**'
  36. - 'vendor/**'
  37. - 'vendor-bin/**'
  38. - '.php-cs-fixer.dist.php'
  39. - 'composer.json'
  40. - 'composer.lock'
  41. - '**.php'
  42. phpunit-memcached:
  43. runs-on: ubuntu-latest
  44. needs: changes
  45. if: needs.changes.outputs.src != 'false'
  46. strategy:
  47. matrix:
  48. php-versions: ['8.1', '8.3']
  49. include:
  50. - php-versions: '8.2'
  51. coverage: ${{ github.event_name != 'pull_request' }}
  52. name: Memcached (PHP ${{ matrix.php-versions }})
  53. services:
  54. memcached:
  55. image: ghcr.io/nextcloud/continuous-integration-redis:latest
  56. ports:
  57. - 11212:11212/tcp
  58. - 11212:11212/udp
  59. steps:
  60. - name: Checkout server
  61. uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
  62. with:
  63. submodules: true
  64. - name: Set up php ${{ matrix.php-versions }}
  65. uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 #v2.31.1
  66. with:
  67. php-version: ${{ matrix.php-versions }}
  68. # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
  69. extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, memcached, openssl, pcntl, posix, redis, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
  70. coverage: ${{ matrix.coverage && 'xdebug' || 'none' }}
  71. ini-file: development
  72. env:
  73. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  74. - name: Set up dependencies
  75. run: composer i
  76. - name: Set up Nextcloud
  77. run: |
  78. mkdir data
  79. cp tests/preseed-config.php config/config.php
  80. ./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
  81. php -f tests/enable_all.php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
  82. - name: PHPUnit memcached tests
  83. run: composer run test -- --group Memcache,Memcached ${{ matrix.coverage && '--coverage-clover ./clover.xml' || '' }}
  84. - name: Upload code coverage
  85. if: ${{ !cancelled() && matrix.coverage }}
  86. uses: codecov/codecov-action@v4.5.0
  87. with:
  88. files: ./clover.xml
  89. flags: phpunit-memcached
  90. - name: Print logs
  91. if: always()
  92. run: |
  93. cat data/nextcloud.log
  94. summary:
  95. permissions:
  96. contents: none
  97. runs-on: ubuntu-latest-low
  98. needs: [changes, phpunit-memcached]
  99. if: always()
  100. name: phpunit-memcached-summary
  101. steps:
  102. - name: Summary status
  103. run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-memcached.result != 'success' }}; then exit 1; fi