Simplify S3 integration tests #183
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: S3 Integration Tests | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| paths: | |
| - ".github/workflows/s3-integration.yml" | |
| - "s3/**" | |
| - "go.mod" | |
| - "go.sum" | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: s3-integration | |
| cancel-in-progress: false | |
| jobs: | |
| # AWS S3 US Integration | |
| aws-s3-us-integration: | |
| name: AWS S3 US Integration | |
| runs-on: ubuntu-latest | |
| # Run on push/workflow_dispatch, skip forks and Dependabot on PRs | |
| if: | | |
| github.event_name == 'push' || | |
| github.event_name == 'workflow_dispatch' || | |
| (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]') | |
| env: | |
| REGION_NAME: us-east-1 | |
| STACK_NAME: s3cli-iam | |
| S3_ENDPOINT_HOST: https://s3.amazonaws.com | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up test environment | |
| uses: ./.github/actions/go-test-bootstrap | |
| - name: Setup AWS infrastructure | |
| uses: ./.github/actions/s3-integration-setup | |
| with: | |
| access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| region_name: ${{ env.REGION_NAME }} | |
| stack_name: ${{ env.STACK_NAME }} | |
| - name: Test Static Credentials | |
| uses: ./.github/actions/s3-integration-run-aws | |
| with: | |
| access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| region_name: ${{ env.REGION_NAME }} | |
| stack_name: ${{ env.STACK_NAME }} | |
| s3_endpoint_host: ${{ env.S3_ENDPOINT_HOST }} | |
| label_filter: 'aws && static && (general || us-east-1)' | |
| - name: Test IAM Roles | |
| uses: ./.github/actions/s3-integration-run-aws-iam | |
| with: | |
| access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| region_name: ${{ env.REGION_NAME }} | |
| stack_name: ${{ env.STACK_NAME }} | |
| label_filter: 'aws && iam-role' | |
| - name: Test Assume Roles | |
| uses: ./.github/actions/s3-integration-run-aws-assume | |
| with: | |
| access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| region_name: ${{ env.REGION_NAME }} | |
| role_arn: ${{ secrets.AWS_ROLE_ARN }} | |
| label_filter: 'aws && assume-role' | |
| - name: Teardown AWS infrastructure | |
| if: always() | |
| uses: ./.github/actions/s3-integration-teardown | |
| with: | |
| access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| region_name: ${{ env.REGION_NAME }} | |
| stack_name: ${{ env.STACK_NAME }} | |
| # AWS S3 Regional Integration | |
| aws-s3-regional-integration: | |
| name: AWS S3 ${{ matrix.name }} Integration | |
| runs-on: ubuntu-latest | |
| # Run on push/workflow_dispatch, skip forks and Dependabot on PRs | |
| if: | | |
| github.event_name == 'push' || | |
| github.event_name == 'workflow_dispatch' || | |
| (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]') | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: Public Read | |
| region_name: us-east-1 | |
| stack_name: s3cli-public-bucket | |
| s3_endpoint_host: https://s3.amazonaws.com | |
| label_filter: 'aws && public-read' | |
| use_esc_credentials: false | |
| - name: Frankfurt | |
| region_name: eu-central-1 | |
| stack_name: s3cli-private-bucket | |
| s3_endpoint_host: https://s3.eu-central-1.amazonaws.com | |
| label_filter: 'aws && static && general && !requires-default-region' | |
| use_esc_credentials: false | |
| - name: European Sovereign Cloud | |
| region_name: eusc-de-east-1 | |
| stack_name: s3cli-private-bucket | |
| s3_endpoint_host: https://s3.eusc-de-east-1.amazonaws.eu | |
| label_filter: 'aws && esc' | |
| use_esc_credentials: true | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up test environment | |
| uses: ./.github/actions/go-test-bootstrap | |
| - name: Setup AWS infrastructure | |
| uses: ./.github/actions/s3-integration-setup | |
| with: | |
| access_key_id: ${{ matrix.use_esc_credentials && secrets.AWS_ESC_ACCESS_KEY_ID || secrets.AWS_ACCESS_KEY_ID }} | |
| secret_access_key: ${{ matrix.use_esc_credentials && secrets.AWS_ESC_SECRET_ACCESS_KEY || secrets.AWS_SECRET_ACCESS_KEY }} | |
| region_name: ${{ matrix.region_name }} | |
| stack_name: ${{ matrix.stack_name }} | |
| - name: Run regional tests | |
| uses: ./.github/actions/s3-integration-run-aws | |
| with: | |
| access_key_id: ${{ matrix.use_esc_credentials && secrets.AWS_ESC_ACCESS_KEY_ID || secrets.AWS_ACCESS_KEY_ID }} | |
| secret_access_key: ${{ matrix.use_esc_credentials && secrets.AWS_ESC_SECRET_ACCESS_KEY || secrets.AWS_SECRET_ACCESS_KEY }} | |
| region_name: ${{ matrix.region_name }} | |
| stack_name: ${{ matrix.stack_name }} | |
| s3_endpoint_host: ${{ matrix.s3_endpoint_host }} | |
| label_filter: ${{ matrix.label_filter }} | |
| - name: Teardown AWS infrastructure | |
| if: always() | |
| uses: ./.github/actions/s3-integration-teardown | |
| with: | |
| access_key_id: ${{ matrix.use_esc_credentials && secrets.AWS_ESC_ACCESS_KEY_ID || secrets.AWS_ACCESS_KEY_ID }} | |
| secret_access_key: ${{ matrix.use_esc_credentials && secrets.AWS_ESC_SECRET_ACCESS_KEY || secrets.AWS_SECRET_ACCESS_KEY }} | |
| region_name: ${{ matrix.region_name }} | |
| stack_name: ${{ matrix.stack_name }} | |
| s3-compatible-integration: | |
| name: S3 Compatible Integration | |
| runs-on: ubuntu-latest | |
| # Run on push/workflow_dispatch, skip forks and Dependabot on PRs | |
| if: | | |
| github.event_name == 'push' || | |
| github.event_name == 'workflow_dispatch' || | |
| (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]') | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up test environment | |
| uses: ./.github/actions/go-test-bootstrap | |
| - name: Run GCS S3 compatible tests | |
| run: | | |
| export access_key_id="${{ secrets.GCP_ACCESS_KEY_ID }}" | |
| export secret_access_key="${{ secrets.GCP_SECRET_ACCESS_KEY }}" | |
| export bucket_name=storage-cli-test-aws-compat | |
| export s3_endpoint_host=storage.googleapis.com | |
| export s3_endpoint_port=443 | |
| export label_filter='s3-compatible' | |
| ./.github/scripts/s3/run-integration-s3-compat.sh |