1
0

s3-primary.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. name: S3 primary storage
  2. on:
  3. pull_request:
  4. paths:
  5. - '.github/workflows/**'
  6. - '3rdparty/**'
  7. - '**/*.php'
  8. - '**/lib/**'
  9. - '**/tests/**'
  10. - '**/vendor-bin/**'
  11. - '.php-cs-fixer.dist.php'
  12. - 'composer.json'
  13. - 'composer.lock'
  14. concurrency:
  15. group: s3-primary-${{ github.head_ref || github.run_id }}
  16. cancel-in-progress: true
  17. jobs:
  18. s3-primary-tests-minio:
  19. runs-on: ubuntu-20.04
  20. if: ${{ github.repository_owner != 'nextcloud-gmbh' }}
  21. strategy:
  22. # do not stop on another job's failure
  23. fail-fast: false
  24. matrix:
  25. php-versions: ['8.0']
  26. key: ['objectstore', 'objectstore_multibucket']
  27. name: php${{ matrix.php-versions }}-${{ matrix.key }}-minio
  28. services:
  29. minio:
  30. env:
  31. MINIO_ACCESS_KEY: minio
  32. MINIO_SECRET_KEY: minio123
  33. image: bitnami/minio:2021.12.29
  34. ports:
  35. - "9000:9000"
  36. steps:
  37. - name: Checkout server
  38. uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
  39. with:
  40. submodules: true
  41. - name: Set up php ${{ matrix.php-versions }}
  42. uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d #v2.25.2
  43. with:
  44. php-version: ${{ matrix.php-versions }}
  45. extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd
  46. env:
  47. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  48. - name: Set up Nextcloud
  49. run: |
  50. composer install
  51. mkdir data
  52. echo '<?php $CONFIG=["${{ matrix.key }}" => ["class" => "OC\Files\ObjectStore\S3", "arguments" => ["bucket" => "nextcloud", "autocreate" => true, "key" => "minio", "secret" => "minio123", "hostname" => "localhost", "port" => 9000, "use_ssl" => false, "use_path_style" => true, "uploadPartSize" => 52428800]]];' > config/config.php
  53. ./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
  54. php -f index.php
  55. - name: Wait for S3
  56. run: |
  57. sleep 10
  58. curl -f -m 1 --retry-connrefused --retry 10 --retry-delay 10 http://localhost:9000/minio/health/ready
  59. - name: PHPUnit
  60. run: composer run test:db
  61. - name: S3 logs
  62. if: always()
  63. run: |
  64. docker ps -a
  65. docker logs $(docker ps -aq)
  66. s3-primary-summary:
  67. runs-on: ubuntu-latest
  68. needs: [s3-primary-tests-minio]
  69. if: always()
  70. steps:
  71. - name: Summary status
  72. run: if ${{ needs.s3-primary-tests-minio.result != 'success' }}; then exit 1; fi