From abfdd63134b8fdd3f5fdf90b4c3af5aa5bdf77d1 Mon Sep 17 00:00:00 2001 From: Christopher Fitzner Date: Tue, 14 Jan 2025 16:41:21 -0800 Subject: [PATCH] Install terraform for github actions that need it The image in use for our ci actions, ubuntu-latest is now defaulting to ubuntu-24.04. In the previous version, terraform was installed by default but has now been removed so we install it manually for each job that relies on it. https://github.com/actions/runner-images/issues/10636 We choose not to pin the version of terraform that is installed so we are always testing against the the latest CLI version. If there is a discrepancy between versions that only affects tests, developers can update to the latest version and ensure the tests work for that. --- .github/workflows/acceptance-tests.yml | 5 +++++ .github/workflows/ci.yaml | 12 ++++++++++++ .github/workflows/pre-release-ci.yaml | 5 +++++ 3 files changed, 22 insertions(+) diff --git a/.github/workflows/acceptance-tests.yml b/.github/workflows/acceptance-tests.yml index 2bc68300..a4574d5e 100644 --- a/.github/workflows/acceptance-tests.yml +++ b/.github/workflows/acceptance-tests.yml @@ -14,6 +14,11 @@ jobs: go-version-file: 'go.mod' cache: true + # We don't pin the version of terraform to ensure the tests run against + # the latest CLI version. + - name: Install terraform + uses: hashicorp/setup-terraform@v3 + - name: Tests run: make testacc env: diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8a76a751..7b3ccc2e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -46,6 +46,11 @@ jobs: with: go-version: 1.22 + # We don't pin the version of terraform to ensure the tests run against + # the latest CLI version. + - name: Install terraform + uses: hashicorp/setup-terraform@v3 + - name: Tests run: make test @@ -72,6 +77,13 @@ jobs: - name: Checkout sources uses: actions/checkout@v4 + # Terraform fmt is run on the docs directory, don't bother pinning this + # version. This will install the latest version. If there is a difference + # in format between the latest version and the local version, the + # developer should update. + - name: Install terraform + uses: hashicorp/setup-terraform@v3 + - name: Build docs run: make generate diff --git a/.github/workflows/pre-release-ci.yaml b/.github/workflows/pre-release-ci.yaml index 837f69c5..6b2ebde4 100644 --- a/.github/workflows/pre-release-ci.yaml +++ b/.github/workflows/pre-release-ci.yaml @@ -19,6 +19,11 @@ jobs: with: go-version: 1.22 + # We don't pin the version of terraform to ensure the tests run against + # the latest CLI version. + - name: Install terraform + uses: hashicorp/setup-terraform@v3 + - name: Tests run: make testacc env: