1
0

object-storage-swift.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. name: Object storage Swift
  2. on:
  3. pull_request:
  4. schedule:
  5. - cron: "15 2 * * *"
  6. concurrency:
  7. group: object-storage-swift-${{ 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. - '**/appinfo/**'
  24. - '**/lib/**'
  25. - '**/templates/**'
  26. - '**/tests/**'
  27. - 'vendor/**'
  28. - 'vendor-bin/**'
  29. - '.php-cs-fixer.dist.php'
  30. - 'composer.json'
  31. - 'composer.lock'
  32. - '**.php'
  33. swift-primary-tests:
  34. runs-on: ubuntu-latest
  35. needs: changes
  36. if: ${{ github.repository_owner != 'nextcloud-gmbh' && needs.changes.outputs.src != 'false' }}
  37. strategy:
  38. matrix:
  39. php-versions: ['8.1', '8.2', '8.3']
  40. include:
  41. - php-versions: '8.3'
  42. coverage: true
  43. name: php${{ matrix.php-versions }}-swift
  44. services:
  45. cache:
  46. image: ghcr.io/nextcloud/continuous-integration-redis:latest
  47. ports:
  48. - 6379:6379/tcp
  49. options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
  50. swift:
  51. image: ghcr.io/cscfi/docker-keystone-swift
  52. ports:
  53. - 5000:5000
  54. - 8080:8080
  55. steps:
  56. - name: Checkout server
  57. uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
  58. with:
  59. submodules: true
  60. - name: Set up php ${{ matrix.php-versions }}
  61. uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
  62. with:
  63. php-version: ${{ matrix.php-versions }}
  64. # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
  65. 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
  66. coverage: ${{ matrix.coverage && 'xdebug' || 'none' }}
  67. ini-file: development
  68. env:
  69. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  70. - name: Set up Nextcloud
  71. env:
  72. OBJECT_STORE: swift
  73. OBJECT_STORE_SECRET: veryfast
  74. run: |
  75. composer install
  76. cp tests/redis.config.php config/
  77. cp tests/preseed-config.php config/config.php
  78. ./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
  79. php -f tests/enable_all.php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
  80. - name: PHPUnit
  81. env:
  82. OBJECT_STORE: swift
  83. OBJECT_STORE_SECRET: veryfast
  84. run: composer run test -- --group PRIMARY-swift ${{ matrix.coverage && ' --coverage-clover ./clover.xml' || '' }}
  85. - name: Upload code coverage
  86. if: ${{ !cancelled() && matrix.coverage }}
  87. uses: codecov/codecov-action@v4.1.1
  88. with:
  89. files: ./clover.xml
  90. flags: phpunit-swift
  91. - name: Swift logs
  92. if: always()
  93. run: |
  94. docker ps -a
  95. docker ps -aq | while read container ; do IMAGE=$(docker inspect --format='{{.Config.Image}}' $container); echo $IMAGE; docker logs $container; echo "\n\n" ; done
  96. swift-primary-summary:
  97. runs-on: ubuntu-latest-low
  98. needs: [changes,swift-primary-tests]
  99. if: always()
  100. steps:
  101. - name: Summary status
  102. run: if ${{ needs.changes.outputs.src != 'false' && needs.swift-primary-tests.result != 'success' }}; then exit 1; fi