integration-s3-primary.yml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. name: S3 primary storage integration tests
  2. on:
  3. pull_request:
  4. concurrency:
  5. group: integration-s3-primary-${{ github.head_ref || github.run_id }}
  6. cancel-in-progress: true
  7. jobs:
  8. changes:
  9. runs-on: ubuntu-latest-low
  10. outputs:
  11. src: ${{ steps.changes.outputs.src}}
  12. steps:
  13. - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
  14. id: changes
  15. continue-on-error: true
  16. with:
  17. filters: |
  18. src:
  19. - '.github/workflows/**'
  20. - '3rdparty/**'
  21. - '**/*.php'
  22. - '**/lib/**'
  23. - '**/tests/**'
  24. - '**/vendor-bin/**'
  25. - 'build/integration/**'
  26. - '.php-cs-fixer.dist.php'
  27. - 'composer.json'
  28. - 'composer.lock'
  29. integration-s3-primary:
  30. runs-on: ubuntu-latest
  31. needs: changes
  32. if: needs.changes.outputs.src != 'false' && github.repository_owner != 'nextcloud-gmbh'
  33. strategy:
  34. # do not stop on another job's failure
  35. fail-fast: false
  36. matrix:
  37. php-versions: ['8.0']
  38. key: ['objectstore', 'objectstore_multibucket']
  39. name: php${{ matrix.php-versions }}-${{ matrix.key }}-minio
  40. services:
  41. redis:
  42. image: ghcr.io/nextcloud/continuous-integration-redis:latest
  43. options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
  44. ports:
  45. - 6379:6379/tcp
  46. minio:
  47. image: bitnami/minio
  48. env:
  49. MINIO_ROOT_USER: nextcloud
  50. MINIO_ROOT_PASSWORD: bWluaW8tc2VjcmV0LWtleS1uZXh0Y2xvdWQ=
  51. MINIO_DEFAULT_BUCKETS: nextcloud
  52. ports:
  53. - "9000:9000"
  54. steps:
  55. - name: Checkout server
  56. uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
  57. with:
  58. submodules: true
  59. - name: Set up php ${{ matrix.php-versions }}
  60. uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
  61. with:
  62. php-version: ${{ matrix.php-versions }}
  63. # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
  64. 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
  65. coverage: 'none'
  66. ini-file: development
  67. env:
  68. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  69. - name: Wait for S3
  70. run: |
  71. sleep 10
  72. curl -f -m 1 --retry-connrefused --retry 10 --retry-delay 10 http://localhost:9000/minio/health/ready
  73. - name: Set up Nextcloud
  74. run: |
  75. mkdir data
  76. echo '<?php $CONFIG=["${{ matrix.key }}" => ["class" => "OC\Files\ObjectStore\S3", "arguments" => ["bucket" => "nextcloud", "autocreate" => true, "key" => "nextcloud", "secret" => "bWluaW8tc2VjcmV0LWtleS1uZXh0Y2xvdWQ=", "hostname" => "localhost", "port" => 9000, "use_ssl" => false, "use_path_style" => true, "uploadPartSize" => 52428800]]];' > config/config.php
  77. echo '<?php $CONFIG=["redis" => ["host" => "localhost", "port" => 6379], "memcache.local" => "\OC\Memcache\Redis", "memcache.distributed" => "\OC\Memcache\Redis"];' > config/redis.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 admin
  79. php -f index.php
  80. - name: Integration
  81. run: |
  82. cd build/integration
  83. bash run.sh --tags "~@failure-s3" dav_features/webdav-related.feature
  84. - name: S3 logs
  85. if: always()
  86. run: |
  87. cat data/nextcloud.log
  88. docker ps -a
  89. docker ps -aq | while read container ; do IMAGE=$(docker inspect --format='{{.Config.Image}}' $container); echo $IMAGE; docker logs $container; echo "\n\n" ; done
  90. s3-primary-integration-summary:
  91. permissions:
  92. contents: none
  93. runs-on: ubuntu-latest-low
  94. needs: [changes, integration-s3-primary]
  95. if: always()
  96. steps:
  97. - name: Summary status
  98. run: if ${{ needs.changes.outputs.src != 'false' && needs.integration-s3-primary.result != 'success' }}; then exit 1; fi