Add E2E tests & Propagate EC2 Tags #12
This file contains 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: "Tests: E2E" | |
concurrency: # This need to ensure that only a single job or workflow using the same concurrency group will run at a time. | |
group: ${{ github.workflow }} | |
cancel-in-progress: false | |
defaults: | |
run: | |
shell: bash | |
env: | |
AWS_PROFILE: debug | |
AWS_REGION: us-east-1 | |
USE_LOCALSTACK: false | |
IZE_VERSION: 0.0.0-dev | |
on: | |
workflow_dispatch: | |
pull_request: | |
jobs: | |
e2e: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
strategy: | |
fail-fast: false | |
max-parallel: 2 # VPCs are limited | |
matrix: | |
include: | |
- name: e2e-complete | |
test_name: e2e-complete | |
env: | |
ENV: ${{ matrix.name }} | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22.x | |
- name: Checkout Code | |
uses: actions/checkout@v2 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_SA }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_SA }} | |
aws-region: ${{ env.AWS_REGION }} | |
- name: IZE setup | |
uses: hazelops/[email protected] | |
with: | |
version: ${{ env.IZE_VERSION }} | |
- name: IZE init | |
run: ize init | |
- name: IZE create AWS Profile | |
run: ize gen aws-profile | |
- name: "Setup Terraform" | |
uses: hashicorp/setup-terraform@v3 | |
with: | |
terraform_version: "1.1.3" | |
- name: Go Test | |
working-directory: test | |
run: | | |
go install github.com/gruntwork-io/terratest/cmd/terratest_log_parser@latest | |
go mod tidy | |
go test -v -timeout 60m -coverprofile=coverage-${{ matrix.test_name }}.out -race -covermode=atomic | tee test_output.log | |
terratest_log_parser -testlog test_output.log -outputdir results | |
ls -la | |
- name: Test Summary | |
uses: test-summary/action@v2 | |
with: | |
paths: | | |
test/results/**/*.xml | |
test/results/*.xml | |
if: always() | |
- name: Upload test summary | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test-summary-${{ matrix.test_name }} | |
path: test/test-summary-${{ matrix.test_name }}.md | |
if: always() | |
- name: Upload Go test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-${{ matrix.test_name }} | |
path: test/coverage-${{ matrix.test_name }}.out | |
if: always() | |
- name: Upload coverage reports to Codecov | |
uses: codecov/[email protected] | |
with: | |
files: test/coverage-${{ matrix.test_name }}.out | |
token: ${{ secrets.CODECOV_TOKEN }} | |
verbose: true | |
name: ${{ matrix.test_name }} | |