s3-external.yml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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: ['7.4', '8.0']
  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@v2
  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
  41. extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd
  42. - name: Set up Nextcloud
  43. run: |
  44. mkdir data
  45. ./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
  46. ./occ app:enable --force ${{ env.APP_NAME }}
  47. php -S localhost:8080 &
  48. - name: PHPUnit
  49. run: |
  50. 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
  51. phpunit --configuration tests/phpunit-autotest-external.xml apps/files_external/tests/Storage/Amazons3Test.php
  52. phpunit --configuration tests/phpunit-autotest-external.xml apps/files_external/tests/Storage/VersionedAmazonS3Test.php
  53. - name: S3 logs
  54. if: always()
  55. run: |
  56. docker ps -a
  57. docker logs $(docker ps -aq)
  58. s3-external-tests-localstack:
  59. runs-on: ubuntu-latest
  60. strategy:
  61. # do not stop on another job's failure
  62. fail-fast: false
  63. matrix:
  64. php-versions: ['7.4', '8.0']
  65. name: php${{ matrix.php-versions }}-localstack
  66. services:
  67. minio:
  68. env:
  69. SERVICES: s3
  70. DEBUG: 1
  71. image: localstack/localstack:0.12.7
  72. ports:
  73. - "4566:4566"
  74. steps:
  75. - name: Checkout server
  76. uses: actions/checkout@v2
  77. with:
  78. submodules: true
  79. - name: Set up php ${{ matrix.php-versions }}
  80. uses: shivammathur/setup-php@v2
  81. with:
  82. php-version: ${{ matrix.php-versions }}
  83. tools: phpunit
  84. extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd
  85. - name: Set up Nextcloud
  86. run: |
  87. mkdir data
  88. ./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
  89. ./occ app:enable --force ${{ env.APP_NAME }}
  90. php -S localhost:8080 &
  91. - name: PHPUnit
  92. run: |
  93. 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
  94. phpunit --configuration tests/phpunit-autotest-external.xml apps/files_external/tests/Storage/Amazons3Test.php
  95. phpunit --configuration tests/phpunit-autotest-external.xml apps/files_external/tests/Storage/VersionedAmazonS3Test.php
  96. - name: S3 logs
  97. if: always()
  98. run: |
  99. docker ps -a
  100. docker logs $(docker ps -aq)
  101. s3-external-summary:
  102. runs-on: ubuntu-latest
  103. needs: [s3-external-tests-minio, s3-external-tests-localstack]
  104. if: always()
  105. steps:
  106. - name: Summary status
  107. run: if ${{ needs.s3-external-tests-minio.result != 'success' }} || ${{ needs.s3-external-tests-localstack.result != 'success' }}; then exit 1; fi