Skip to content

Implement comparison state checks to replace TestCheckResourceAttrPtr, TestCheckResourceAttrPair and TestCheckTypeSetElemAttrPair #504

Implement comparison state checks to replace TestCheckResourceAttrPtr, TestCheckResourceAttrPair and TestCheckTypeSetElemAttrPair

Implement comparison state checks to replace TestCheckResourceAttrPtr, TestCheckResourceAttrPair and TestCheckTypeSetElemAttrPair #504

Workflow file for this run

# Continuous integration handling for Go
name: ci-go
on:
pull_request:
paths:
- .github/workflows/ci-go.yml
- .golangci.yml
- go.mod
- '**.go'
permissions:
contents: read
jobs:
golangci-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: 'go.mod'
- run: go mod download
- uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64 # v6.0.1
test:
name: test (Go ${{ matrix.go-version }} / TF ${{ matrix.terraform }})
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.22', '1.21' ]
terraform: ${{ fromJSON(vars.TF_VERSIONS_PROTOCOL_V5) }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: ${{ matrix.go-version }}
- uses: hashicorp/setup-terraform@651471c36a6092792c552e8b1bef71e592b462d8 # v3.1.1
with:
terraform_version: ${{ matrix.terraform }}
terraform_wrapper: false
- run: go mod download
- run: go test -coverprofile=coverage.out ./...
env:
TF_ACC: "1"
- name: Remove wildcard suffix from TF version
id: tf_version
run: |
orginal_version="${{ matrix.terraform }}"
wildcard=".*"
echo "version=${orginal_version%"$wildcard"}" >> "$GITHUB_OUTPUT"
- run: go tool cover -html=coverage.out -o coverage.html
- uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: go-${{ matrix.go-version }}-terraform-${{ steps.tf_version.outputs.version }}-coverage
path: coverage.html