integration-s3-primary.yml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. # SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
  2. # SPDX-License-Identifier: MIT
  3. name: S3 primary storage integration tests
  4. on:
  5. pull_request:
  6. concurrency:
  7. group: integration-s3-primary-${{ 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-s3-primary:
  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.1']
  40. key: ['objectstore', 'objectstore_multibucket']
  41. name: php${{ matrix.php-versions }}-${{ matrix.key }}-minio
  42. services:
  43. redis:
  44. image: ghcr.io/nextcloud/continuous-integration-redis:latest
  45. options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
  46. ports:
  47. - 6379:6379/tcp
  48. minio:
  49. image: bitnami/minio
  50. env:
  51. MINIO_ROOT_USER: nextcloud
  52. MINIO_ROOT_PASSWORD: bWluaW8tc2VjcmV0LWtleS1uZXh0Y2xvdWQ=
  53. MINIO_DEFAULT_BUCKETS: nextcloud
  54. ports:
  55. - "9000:9000"
  56. steps:
  57. - name: Checkout server
  58. uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
  59. with:
  60. submodules: true
  61. - name: Set up php ${{ matrix.php-versions }}
  62. uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 #v2.31.1
  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, openssl, pcntl, posix, redis, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
  67. coverage: 'none'
  68. ini-file: development
  69. env:
  70. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  71. - name: Wait for S3
  72. run: |
  73. sleep 10
  74. curl -f -m 1 --retry-connrefused --retry 10 --retry-delay 10 http://localhost:9000/minio/health/ready
  75. - name: Set up Nextcloud
  76. run: |
  77. mkdir data
  78. 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
  79. echo '<?php $CONFIG=["redis" => ["host" => "localhost", "port" => 6379], "memcache.local" => "\OC\Memcache\Redis", "memcache.distributed" => "\OC\Memcache\Redis"];' > config/redis.config.php
  80. ./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
  81. php -f index.php
  82. - name: Integration
  83. run: |
  84. cd build/integration
  85. bash run.sh --tags "~@failure-s3" dav_features/webdav-related.feature
  86. - name: S3 logs
  87. if: always()
  88. run: |
  89. cat data/nextcloud.log
  90. docker ps -a
  91. docker ps -aq | while read container ; do IMAGE=$(docker inspect --format='{{.Config.Image}}' $container); echo $IMAGE; docker logs $container; echo "\n\n" ; done
  92. s3-primary-integration-summary:
  93. permissions:
  94. contents: none
  95. runs-on: ubuntu-latest-low
  96. needs: [changes, integration-s3-primary]
  97. if: always()
  98. steps:
  99. - name: Summary status
  100. run: if ${{ needs.changes.outputs.src != 'false' && needs.integration-s3-primary.result != 'success' }}; then exit 1; fi