s3-external.yml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. name: S3 External storage
  2. on:
  3. push:
  4. branches:
  5. - master
  6. - stable*
  7. paths:
  8. - 'apps/files_external/**'
  9. pull_request:
  10. paths:
  11. - 'apps/files_external/**'
  12. env:
  13. APP_NAME: files_external
  14. jobs:
  15. s3-external-tests-minio:
  16. runs-on: ubuntu-latest
  17. if: ${{ github.repository_owner != 'nextcloud-gmbh' }}
  18. strategy:
  19. # do not stop on another job's failure
  20. fail-fast: false
  21. matrix:
  22. php-versions: ['7.4', '8.0']
  23. name: php${{ matrix.php-versions }}-minio
  24. services:
  25. minio:
  26. env:
  27. MINIO_ACCESS_KEY: minio
  28. MINIO_SECRET_KEY: minio123
  29. image: bitnami/minio:2021.10.6
  30. ports:
  31. - "9000:9000"
  32. steps:
  33. - name: Checkout server
  34. uses: actions/checkout@v2
  35. with:
  36. submodules: true
  37. - name: Set up php ${{ matrix.php-versions }}
  38. uses: shivammathur/setup-php@v2
  39. with:
  40. php-version: ${{ matrix.php-versions }}
  41. tools: phpunit:9
  42. extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd
  43. - name: Set up Nextcloud
  44. run: |
  45. mkdir data
  46. ./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
  47. ./occ app:enable --force ${{ env.APP_NAME }}
  48. php -S localhost:8080 &
  49. - name: PHPUnit
  50. run: |
  51. echo "<?php return ['run' => true,'hostname' => 'localhost','key' => 'minio','secret' => 'minio123', 'bucket' => 'bucket', 'port' => 9000, 'use_ssl' => false, 'autocreate' => true, 'use_path_style' => true];" > apps/${{ env.APP_NAME }}/tests/config.amazons3.php
  52. phpunit --configuration tests/phpunit-autotest-external.xml apps/files_external/tests/Storage/Amazons3Test.php
  53. phpunit --configuration tests/phpunit-autotest-external.xml apps/files_external/tests/Storage/VersionedAmazonS3Test.php
  54. - name: S3 logs
  55. if: always()
  56. run: |
  57. docker ps -a
  58. docker logs $(docker ps -aq)
  59. s3-external-tests-localstack:
  60. runs-on: ubuntu-latest
  61. if: ${{ github.repository_owner != 'nextcloud-gmbh' }}
  62. strategy:
  63. # do not stop on another job's failure
  64. fail-fast: false
  65. matrix:
  66. php-versions: ['7.4', '8.0']
  67. name: php${{ matrix.php-versions }}-localstack
  68. services:
  69. minio:
  70. env:
  71. SERVICES: s3
  72. DEBUG: 1
  73. image: localstack/localstack:0.12.7
  74. ports:
  75. - "4566:4566"
  76. steps:
  77. - name: Checkout server
  78. uses: actions/checkout@v2
  79. with:
  80. submodules: true
  81. - name: Set up php ${{ matrix.php-versions }}
  82. uses: shivammathur/setup-php@v2
  83. with:
  84. php-version: ${{ matrix.php-versions }}
  85. tools: phpunit:9
  86. extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd
  87. - name: Set up Nextcloud
  88. run: |
  89. mkdir data
  90. ./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
  91. ./occ app:enable --force ${{ env.APP_NAME }}
  92. php -S localhost:8080 &
  93. - name: PHPUnit
  94. run: |
  95. echo "<?php return ['run' => true,'hostname' => 'localhost','key' => 'ignored','secret' => 'ignored', 'bucket' => 'bucket', 'port' => 4566, 'use_ssl' => false, 'autocreate' => true, 'use_path_style' => true];" > apps/${{ env.APP_NAME }}/tests/config.amazons3.php
  96. phpunit --configuration tests/phpunit-autotest-external.xml apps/files_external/tests/Storage/Amazons3Test.php
  97. phpunit --configuration tests/phpunit-autotest-external.xml apps/files_external/tests/Storage/VersionedAmazonS3Test.php
  98. - name: S3 logs
  99. if: always()
  100. run: |
  101. docker ps -a
  102. docker logs $(docker ps -aq)
  103. s3-external-summary:
  104. runs-on: ubuntu-latest
  105. needs: [s3-external-tests-minio, s3-external-tests-localstack]
  106. if: always()
  107. steps:
  108. - name: Summary status
  109. run: if ${{ needs.s3-external-tests-minio.result != 'success' }} || ${{ needs.s3-external-tests-localstack.result != 'success' }}; then exit 1; fi