You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

phpunit-memcached.yml 3.7KB

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