Skip to content

feat: Adding GHA workflow for UAT Test Suite #44

feat: Adding GHA workflow for UAT Test Suite

feat: Adding GHA workflow for UAT Test Suite #44

Workflow file for this run

name: terratests-uat-suite
on:
pull_request:
workflow_dispatch:
jobs:
setup-tests:
name: Setup UAT Tests
runs-on: ubuntu-latest
env:
EQUINIX_API_ENDPOINT: "https://uatapi.equinix.com"
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: './go.mod'
id: go
- name: Get dependencies
run: |
go mod download
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ matrix.terraform }}
terraform_wrapper: false
- name: Setup Variables Files
env:
GH_TOKEN: ${{ secrets.SECRET_TOKEN }}
run: |

Check failure on line 38 in .github/workflows/test-uat-suite.yaml

View workflow run for this annotation

GitHub Actions / terratests-uat-suite

Invalid workflow file

The workflow is not valid. .github/workflows/test-uat-suite.yaml (Line: 38, Col: 14): Unexpected symbol: ','. Located at position 28 within expression: secrets['TEST_DATA_UAT_{0}','$directory_name'
DirectoryList=("port-2-port-connection: ./examples/port-2-port-connection")
for list in ../../tests/uat/*; do
if [[ "$list" == *"port-2-aws"* ]]; then
directory_name=$(basename "$list")
secret_value="${{ secrets['TEST_DATA_UAT_{0}','$directory_name' }}"
echo "$secret_value" >> list/terraform.tfvars.json
fi
done
printf '%s\n' "${DirectoryList[@]}"
- name: Run Go Tests
run:
go test ./tests/uat -v -coverprofile coverage_uat_modules.txt -covermode=atomic -count 1 -parallel 8 -timeout 180m
- name: Upload test coverage to Codecov
if: ${{ always() }}
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage_uat_modules.txt