Skip to content

Commit b7cb0b8

Browse files
authored
Set up nightly build against mainline terraform (#2785)
1 parent 9ecda25 commit b7cb0b8

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Acceptance Tests (kind)
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
kindVersion:
7+
description: The kind version
8+
default: 0.20.0
9+
runTests:
10+
description: The regex passed to the -run option of `go test`
11+
default: "^TestAcc"
12+
terraformVersion:
13+
description: Terraform version
14+
default: 1.12.0
15+
parallelRuns:
16+
description: The maximum number of tests to run simultaneously
17+
default: 8
18+
schedule:
19+
- cron: '0 21 * * *'
20+
21+
env:
22+
KUBECONFIG: ${{ github.workspace }}/.kube/config
23+
KIND_VERSION: ${{ github.event.inputs.kindVersion || '0.30.0' }}
24+
PARALLEL_RUNS: ${{ github.event.inputs.parallelRuns || '8' }}
25+
TERRAFORM_VERSION: ${{ github.event.inputs.terraformVersion || '1.12.0' }}
26+
27+
jobs:
28+
acceptance_tests_kind:
29+
if: ${{ github.repository_owner == 'hashicorp' }}
30+
runs-on: custom-linux-large
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
34+
- name: Set up Go
35+
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
36+
with:
37+
go-version-file: 'go.mod'
38+
- name: Install Terraform From Source
39+
run: |
40+
git clone https://github.com/hashicorp/terraform.git
41+
cd terraform
42+
git switch main
43+
go build -o terraform
44+
mv terraform /usr/bin/terraform
45+
- name: Setup kind
46+
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
47+
with:
48+
wait: 2m
49+
version: v${{ env.KIND_VERSION }}
50+
node_image: kindest/node:v1.34.0@sha256:7416a61b42b1662ca6ca89f02028ac133a309a2a30ba309614e8ec94d976dc5a
51+
config: .github/config/acceptance_tests_kind_config.yaml
52+
- name: Run Acceptance Test Suite
53+
env:
54+
KUBE_CONFIG_PATH: ${{ env.KUBECONFIG }}
55+
TESTARGS: -run ${{ github.event.inputs.runTests || '^TestAcc' }}
56+
# Do not set TF_ACC_TERRAFORM_PATH or TF_ACC_TERRAFORM_VERSION.
57+
# In this case, the framework will search for the Terraform CLI binary based on the operating system PATH.
58+
# Eventually, it will use the one we set up.
59+
# More information: https://developer.hashicorp.com/terraform/plugin/sdkv2/testing/acceptance-tests#terraform-cli-installation-behaviors
60+
run: |
61+
make testacc
62+
make frameworkacc

0 commit comments

Comments
 (0)