You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

s3-external.yml 4.3KB

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. strategy:
  18. # do not stop on another job's failure
  19. fail-fast: false
  20. matrix:
  21. php-versions: ['8.0', '8.1']
  22. name: php${{ matrix.php-versions }}-minio
  23. services:
  24. minio:
  25. env:
  26. MINIO_ACCESS_KEY: minio
  27. MINIO_SECRET_KEY: minio123
  28. image: bitnami/minio:2021.10.6
  29. ports:
  30. - "9000:9000"
  31. steps:
  32. - name: Checkout server
  33. uses: actions/checkout@v3
  34. with:
  35. submodules: true
  36. - name: Set up php ${{ matrix.php-versions }}
  37. uses: shivammathur/setup-php@v2
  38. with:
  39. php-version: ${{ matrix.php-versions }}
  40. tools: phpunit:9
  41. extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd
  42. env:
  43. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  44. - name: Set up Nextcloud
  45. run: |
  46. mkdir data
  47. ./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
  48. ./occ app:enable --force ${{ env.APP_NAME }}
  49. php -S localhost:8080 &
  50. - name: PHPUnit
  51. run: |
  52. echo "<?php return ['run' => true, 'secret' => 'actually-not-secret', 'passwordsalt' => 'actually-not-secret', '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
  53. phpunit --configuration tests/phpunit-autotest-external.xml apps/files_external/tests/Storage/Amazons3Test.php
  54. phpunit --configuration tests/phpunit-autotest-external.xml apps/files_external/tests/Storage/VersionedAmazonS3Test.php
  55. - name: S3 logs
  56. if: always()
  57. run: |
  58. docker ps -a
  59. docker logs $(docker ps -aq)
  60. s3-external-tests-localstack:
  61. runs-on: ubuntu-latest
  62. strategy:
  63. # do not stop on another job's failure
  64. fail-fast: false
  65. matrix:
  66. php-versions: ['8.0', '8.1']
  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@v3
  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. env:
  88. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  89. - name: Set up Nextcloud
  90. run: |
  91. mkdir data
  92. ./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
  93. ./occ app:enable --force ${{ env.APP_NAME }}
  94. php -S localhost:8080 &
  95. - name: PHPUnit
  96. run: |
  97. 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
  98. phpunit --configuration tests/phpunit-autotest-external.xml apps/files_external/tests/Storage/Amazons3Test.php
  99. phpunit --configuration tests/phpunit-autotest-external.xml apps/files_external/tests/Storage/VersionedAmazonS3Test.php
  100. - name: S3 logs
  101. if: always()
  102. run: |
  103. docker ps -a
  104. docker logs $(docker ps -aq)
  105. s3-external-summary:
  106. runs-on: ubuntu-latest
  107. needs: [s3-external-tests-minio, s3-external-tests-localstack]
  108. if: always()
  109. steps:
  110. - name: Summary status
  111. run: if ${{ needs.s3-external-tests-minio.result != 'success' }} || ${{ needs.s3-external-tests-localstack.result != 'success' }}; then exit 1; fi