Skip to content

chore(deps): bump hashicorp/setup-terraform from 2 to 4 #1303

chore(deps): bump hashicorp/setup-terraform from 2 to 4

chore(deps): bump hashicorp/setup-terraform from 2 to 4 #1303

Workflow file for this run

# This GitHub action runs your tests for each commit push and/or PR. Optionally
# you can turn it on using a cron schedule for regular testing.
#
name: Tests
on:
pull_request:
paths-ignore:
- 'README.md'
push:
paths-ignore:
- 'README.md'
# For systems with an upstream API that could drift unexpectedly (like most SaaS systems, etc.),
# we recommend testing at a regular interval not necessarily tied to code changes. This will
# ensure you are alerted to something breaking due to an API change, even if the code did not
# change.
# schedule:
# - cron: '0 13 * * *'
jobs:
# ensure the code builds...
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache: true
id: go
- name: Get dependencies
run: |
go mod download
- name: Build
run: |
go build -v .
# Platform-independent safety net: formatting, static analysis and unit
# tests of the pure packages. Protects the state-facing paths (flatten/
# expand helpers, reconciliation gates, Optional+Computed handling)
# without requiring a live Cloud Temple platform (#264).
unit:
name: Unit tests & vet
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache: true
- name: Get dependencies
run: |
go mod download
- name: Check formatting (gofmt)
run: |
unformatted="$(gofmt -l .)"
if [ -n "$unformatted" ]; then
echo "The following files are not gofmt-formatted:"
echo "$unformatted"
exit 1
fi
- name: Vet (whole module — compiles every _test.go without running it)
run: |
# `go vet ./...` type-checks and compiles every package, including the
# acceptance-test packages (internal/client/tests, internal/provider/tests).
# It does NOT execute the tests, so no live Cloud Temple platform is needed.
# This is what catches client/test signature drift that the build job misses.
go vet ./...
- name: Static analysis (staticcheck)
run: |
# Pinned staticcheck (supports Go 1.24). Analyses the whole module,
# including the acceptance-test packages — which are compiled but not
# run — without any live Cloud Temple platform. Catches unused code,
# dead stores and suspicious constructs that build/vet miss (#264).
go run honnef.co/go/tools/cmd/staticcheck@2025.1.1 ./...
- name: Unit tests + coverage ratchet (platform-independent packages)
run: |
# Runs the pure packages under -race with coverage and fails if any
# package drops below its recorded floor (scripts/coverage_floor.txt).
# -race future-proofs the pure packages (token cache, httptest servers,
# timers); the ratchet makes "tests where they are missing" a systemic
# guard, not a discretionary habit (#264, #293). CGO is available on the
# GitHub ubuntu runners.
./scripts/coverage_ratchet.sh
generate:
runs-on: ubuntu-latest
steps:
- uses: hashicorp/setup-terraform@v4
with:
terraform_version: 'v1.5.7'
terraform_wrapper: false
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache: true
- run: go generate ./...
- name: git diff
run: |
git diff --compact-summary --exit-code || \
(echo; echo "Unexpected difference in directories after code generation. Run 'go generate ./...' command and commit."; exit 1)
# run acceptance tests in a matrix with Terraform core versions
# test:
# name: Matrix Test
# needs: build
# runs-on: ubuntu-latest
# timeout-minutes: 15
# strategy:
# fail-fast: false
# matrix:
# # list whatever Terraform versions here you would like to support
# terraform:
# - '0.12.*'
# - '0.13.*'
# - '0.14.*'
# - '0.15.*'
# - '1.0.*'
# - '1.1.*'
# - '1.2.*'
# steps:
# - name: Check out code into the Go module directory
# uses: actions/checkout@v3
# - name: Set up Go
# uses: actions/setup-go@v4
# with:
# go-version-file: 'go.mod'
# cache: true
# id: go
# - uses: hashicorp/setup-terraform@v4
# with:
# terraform_version: ${{ matrix.terraform }}
# terraform_wrapper: false
# - name: Get dependencies
# run: |
# go mod download
# - name: TF tests
# timeout-minutes: 10
# run: |
# go test -v -cover ./...