test 3 examples - go #32
Workflow file for this run
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: Terraform Terratest with Go | |
on: | |
push: | |
branches: | |
- feature/update-examples | |
# on: | |
# workflow_dispatch: | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
terratest: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Configure AWS credentials via OIDC | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
role-to-assume: ${{ secrets.ARC_IAC_TERRATEST_ROLE }} | |
aws-region: us-east-1 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.24' | |
- name: Set up Terraform | |
uses: hashicorp/setup-terraform@v2 | |
with: | |
terraform_version: 1.5.7 | |
terraform_wrapper: false | |
- name: Create test directory and download go from S3 | |
run: | | |
mkdir -p terra-test | |
aws s3 cp s3://arc-iac-golang-terraform-terratest/terra_test.go terra-test/terra_test.go | |
- name: Initialize Go module and install dependencies | |
run: | | |
cd terra-test | |
ls | |
go mod init terraform-test || true | |
go get github.com/gruntwork-io/terratest/modules/terraform | |
go get github.com/stretchr/testify/assert | |
go mod tidy | |
go test -v -timeout 0 | |