s3-primary.yml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. name: S3 primary storage
  2. on:
  3. pull_request:
  4. push:
  5. branches:
  6. - master
  7. - stable*
  8. jobs:
  9. s3-primary-tests-minio:
  10. runs-on: ubuntu-20.04
  11. if: ${{ github.repository_owner != 'nextcloud-gmbh' }}
  12. strategy:
  13. # do not stop on another job's failure
  14. fail-fast: false
  15. matrix:
  16. php-versions: ['8.0']
  17. key: ['objectstore', 'objectstore_multibucket']
  18. name: php${{ matrix.php-versions }}-${{ matrix.key }}-minio
  19. services:
  20. minio:
  21. env:
  22. MINIO_ACCESS_KEY: minio
  23. MINIO_SECRET_KEY: minio123
  24. image: bitnami/minio:2021.12.29
  25. ports:
  26. - "9000:9000"
  27. steps:
  28. - name: Checkout server
  29. uses: actions/checkout@v2
  30. with:
  31. submodules: true
  32. - name: Set up php ${{ matrix.php-versions }}
  33. uses: shivammathur/setup-php@v2
  34. with:
  35. php-version: ${{ matrix.php-versions }}
  36. tools: phpunit:9
  37. extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd
  38. - name: Set up Nextcloud
  39. run: |
  40. mkdir data
  41. 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
  42. ./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
  43. php -f index.php
  44. - name: Wait for S3
  45. run: |
  46. sleep 10
  47. curl -f -m 1 --retry-connrefused --retry 10 --retry-delay 10 http://localhost:9000/minio/health/ready
  48. - name: PHPUnit
  49. working-directory: tests
  50. run: phpunit --configuration phpunit-autotest.xml --group DB,SLOWDB
  51. - name: S3 logs
  52. if: always()
  53. run: |
  54. docker ps -a
  55. docker logs $(docker ps -aq)
  56. s3-primary-summary:
  57. runs-on: ubuntu-latest
  58. needs: [s3-primary-tests-minio]
  59. if: always()
  60. steps:
  61. - name: Summary status
  62. run: if ${{ needs.s3-primary-tests-minio.result != 'success' }}; then exit 1; fi