Skip to content

Commit 1f05fc1

Browse files
authored
ci: add opentofu v1.6 to e2e test matrix (#849)
- Start testing our provider against OpenTofu 1.6. - Rename integrations tests to e2e tests - Rename "test" tests to unit tests - Add concurrency group for e2e test and cancel in progress.
1 parent af68542 commit 1f05fc1

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

.github/workflows/test.yml

+30-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
pull_request:
77

88
jobs:
9-
test:
9+
unit:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v4
@@ -21,31 +21,54 @@ jobs:
2121
with:
2222
flags: unit
2323

24-
integration:
24+
e2e:
2525
runs-on: ubuntu-latest
2626

2727
permissions:
2828
id-token: write
2929

30+
concurrency:
31+
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.tool }}-${{ matrix.version }}
32+
cancel-in-progress: true
33+
3034
strategy:
31-
matrix:
32-
terraform: [v1.6.x, v1.7.x]
3335
fail-fast: false
36+
matrix:
37+
include:
38+
- tool: opentofu
39+
version: v1.6.x
40+
- tool: terraform
41+
version: v1.6.x
42+
- tool: terraform
43+
version: v1.7.x
3444

3545
steps:
3646
- uses: actions/checkout@v4
3747

38-
- uses: hashicorp/setup-terraform@v3
48+
- if: matrix.tool == 'terraform'
49+
uses: hashicorp/setup-terraform@v3
3950
with:
40-
terraform_version: ${{ matrix.terraform }}
51+
terraform_version: ${{ matrix.version }}
4152
terraform_wrapper: false
4253

54+
- if: matrix.tool == 'opentofu'
55+
uses: opentofu/setup-opentofu@v1
56+
with:
57+
tofu_version: ${{ matrix.version }}
58+
tofu_wrapper: false
59+
4360
- uses: actions/setup-go@v5
4461
with:
4562
go-version-file: go.mod
4663

4764
- uses: hetznercloud/tps-action@main
4865

66+
- if: matrix.tool == 'opentofu'
67+
run: |
68+
echo TF_ACC_TERRAFORM_PATH="$(which tofu)" >> $GITHUB_ENV
69+
echo TF_ACC_PROVIDER_NAMESPACE="hashicorp" >> $GITHUB_ENV
70+
echo TF_ACC_PROVIDER_HOST="registry.opentofu.org" >> $GITHUB_ENV
71+
4972
- run: make testacc TESTARGS="-coverprofile=coverage.txt -coverpkg=./..."
5073
env:
5174
# Domain must be available in the account running the tests. This domain is
@@ -62,5 +85,5 @@ jobs:
6285
- uses: actions/upload-artifact@v4
6386
if: always()
6487
with:
65-
name: debug-logs-${{ matrix.terraform }}
88+
name: debug-logs-${{ matrix.tool }}-${{ matrix.version }}
6689
path: internal/e2etests/**/*.log

0 commit comments

Comments
 (0)