generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 17
64 lines (57 loc) · 1.88 KB
/
test-opentofu.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# This is a restricted test set for OpenTofu
# The full test is defined in the test.yml workflow.
# This file is intended to focus testing the OpenTofu compatibility against the latest provider version.
name: OpenTofu Provider Tests
on:
workflow_dispatch:
# Testing only needs permissions to read the repository contents.
permissions:
contents: read
jobs:
# Ensure project builds before running testing matrix
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4 # v4.0.0
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: 'go.mod'
cache: true
- run: go mod download
- run: go build -v .
- name: Run linters
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v3.7.1
with:
version: latest
# Run acceptance tests in a matrix with OpenTofu CLI versions
test:
name: Terraform Provider Acceptance Tests for OpenTofu
needs: build
runs-on: ubuntu-latest
# Timeout for tests set to 25 minutes to safeguard long running tests (specifically for service instances)
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
# list of OpenTofu versions to test against
opentofu:
- '1.6.*'
- '1.7.*'
- '1.8.*'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
with:
go-version-file: 'go.mod'
cache: true
- uses: opentofu/setup-opentofu@v1
with:
tofu_version: ${{ matrix.opentofu }}
tofu_wrapper: false
- run: go mod download
- env:
TF_ACC: "1"
run: go test -v -cover -coverprofile=cover.out -timeout=1800s -parallel=4 ./...
timeout-minutes: 20