Files
opentf/.github/workflows/build.yml
Martin Atkins 85e8e539d8 GitHub ACtions: use actions/setup-go v6.4.0
The version we were previously using has an incorrect hard-coded URL
template for downloading Go versions that are not yet in the action's own
manifest file, which means that it can't successfully install any Go
version that hasn't been added to the manifest yet.

This new version is updated to use an endpoint on https://go.dev/ that is
set up to redirect to whatever the correct location is, which was
recommended by a member of the Go team in actions/setup-go#665 and so is
presumably intended to remain valid.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2026-04-07 14:15:03 -07:00

94 lines
3.6 KiB
YAML

name: build
on:
workflow_dispatch:
push:
branches:
- main
- 'v[0-9]+.[0-9]+'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
permissions:
contents: read
jobs:
build:
strategy:
matrix:
include:
- {goos: "freebsd", goarch: "386", runson: "ubuntu-latest", cgo-enabled: "0"}
- {goos: "freebsd", goarch: "amd64", runson: "ubuntu-latest", cgo-enabled: "0"}
- {goos: "freebsd", goarch: "arm", runson: "ubuntu-latest", cgo-enabled: "0"}
- {goos: "linux", goarch: "386", runson: "ubuntu-latest", cgo-enabled: "0"}
- {goos: "linux", goarch: "amd64", runson: "ubuntu-latest", cgo-enabled: "0"}
- {goos: "linux", goarch: "arm", runson: "ubuntu-latest", cgo-enabled: "0"}
- {goos: "linux", goarch: "arm64", runson: "ubuntu-latest", cgo-enabled: "0"}
- {goos: "openbsd", goarch: "386", runson: "ubuntu-latest", cgo-enabled: "0"}
- {goos: "openbsd", goarch: "amd64", runson: "ubuntu-latest", cgo-enabled: "0"}
- {goos: "solaris", goarch: "amd64", runson: "ubuntu-latest", cgo-enabled: "0"}
- {goos: "windows", goarch: "386", runson: "ubuntu-latest", cgo-enabled: "0"}
- {goos: "windows", goarch: "amd64", runson: "ubuntu-latest", cgo-enabled: "0"}
- {goos: "darwin", goarch: "amd64", runson: "macos-latest", cgo-enabled: "1"}
- {goos: "darwin", goarch: "arm64", runson: "macos-latest", cgo-enabled: "1"}
fail-fast: false
name: Build for ${{ matrix.goos }}_${{ matrix.goarch }}
runs-on: ubuntu-latest
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
steps:
- name: "Fetch source code"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install Go toolchain
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: 'go.mod'
- name: "Build tofu executable"
run: |
go build ./cmd/tofu
e2e-tests:
strategy:
matrix:
include:
- { runson: ubuntu-latest, goos: linux, goarch: "amd64" }
- { runson: ubuntu-latest, goos: linux, goarch: "386" }
# - { runson: ubuntu-24.04-arm, goos: linux, goarch: "arm" } Disabled due to missing `template` provider, should switch it in the tests
# - { runson: ubuntu-24.04-arm, goos: linux, goarch: "arm64" } Disabled due to missing `template` provider, should switch it in the tests
- { runson: macos-latest, goos: darwin, goarch: "amd64" }
- { runson: windows-latest, goos: windows, goarch: "amd64" }
- { runson: windows-latest, goos: windows, goarch: "386" }
fail-fast: false
name: "End-to-end Tests for ${{ matrix.goos }}_${{ matrix.goarch }}"
runs-on: ${{ matrix.runson }}
env:
TF_APPEND_USER_AGENT: E2E-Test
TF_ACC: 1
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
steps:
# 👇🏾 GH actions supports only "AMD64 arch", so we are using this action
# for testing on non amd64 envs like 386, arm64 etc...
- name: "Set up QEMU"
if: matrix.goos == 'linux' && matrix.goarch != 'amd64' && matrix.goarch != 'arm64'
uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a # v3.3.0
- name: "Fetch source code"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install Go toolchain
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: 'go.mod'
- name: "End-to-end tests"
run: |
go test -v ./internal/command/e2etest