test-s3-over-https-using-awscli.yml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. name: "test s3 over https using aws-cli"
  2. on:
  3. push:
  4. branches: [master, test-https-s3-awscli]
  5. pull_request:
  6. branches: [master, test-https-s3-awscli]
  7. env:
  8. AWS_ACCESS_KEY_ID: some_access_key1
  9. AWS_SECRET_ACCESS_KEY: some_secret_key1
  10. AWS_ENDPOINT_URL: https://localhost:8443
  11. defaults:
  12. run:
  13. working-directory: weed
  14. jobs:
  15. awscli-tests:
  16. runs-on: ubuntu-latest
  17. timeout-minutes: 5
  18. steps:
  19. - uses: actions/checkout@v5
  20. - uses: actions/setup-go@v6
  21. with:
  22. go-version: ^1.24
  23. - name: Build SeaweedFS
  24. run: |
  25. go build
  26. - name: Start SeaweedFS
  27. run: |
  28. set -e
  29. mkdir -p /tmp/data
  30. ./weed server -s3 -dir=/tmp/data -s3.config=../docker/compose/s3.json &
  31. until curl -s http://localhost:8333/ > /dev/null; do sleep 1; done
  32. - name: Setup Caddy
  33. run: |
  34. curl -fsSL "https://caddyserver.com/api/download?os=linux&arch=amd64" -o caddy
  35. chmod +x caddy
  36. ./caddy version
  37. echo "{
  38. auto_https disable_redirects
  39. local_certs
  40. }
  41. localhost:8443 {
  42. tls internal
  43. reverse_proxy localhost:8333
  44. }" > Caddyfile
  45. - name: Start Caddy
  46. run: |
  47. ./caddy start
  48. until curl -fsS --insecure https://localhost:8443 > /dev/null; do sleep 1; done
  49. - name: Create Bucket
  50. run: |
  51. aws --no-verify-ssl s3api create-bucket --bucket bucket
  52. - name: Test PutObject
  53. run: |
  54. set -e
  55. dd if=/dev/urandom of=generated bs=1M count=2
  56. aws --no-verify-ssl s3api put-object --bucket bucket --key test-putobject --body generated
  57. aws --no-verify-ssl s3api get-object --bucket bucket --key test-putobject downloaded
  58. diff -q generated downloaded
  59. rm -f generated downloaded
  60. - name: Test Multi-part Upload
  61. run: |
  62. set -e
  63. dd if=/dev/urandom of=generated bs=1M count=32
  64. aws --no-verify-ssl s3 cp --no-progress generated s3://bucket/test-multipart
  65. aws --no-verify-ssl s3 cp --no-progress s3://bucket/test-multipart downloaded
  66. diff -q generated downloaded
  67. rm -f generated downloaded