-
Notifications
You must be signed in to change notification settings - Fork 2
196 lines (171 loc) · 5.58 KB
/
test.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
---
# This workflow uses actions that are not certified by GitHub. They are provided
# by a third-party and are governed by separate terms of service, privacy
# policy, and support documentation.
name: Tests
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
mutation:
runs-on: ubuntu-latest
name: Mutation
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
github.com:443
golang.org:443
objects.githubusercontent.com:443
proxy.golang.org:443
- name: Checkout Source
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: ">= 1.22.1"
cache: true
- name: Run mutation tests
run: |
cd ./corefunc && go test -tags=mutation -count=1 -parallel=$(nproc) -timeout 30s -ooze.v=true \
| grep -v "^[[:lower:]]" | grep -v "^)"
unit:
runs-on: ubuntu-latest
name: Unit
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
disable-sudo: true
egress-policy: block #audit
allowed-endpoints: >
api.github.com:443
github.com:443
golang.org:443
objects.githubusercontent.com:443
proxy.golang.org:443
- name: Checkout Source
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: ">= 1.22.1"
cache: true
- name: Run unit tests
run: |
go test -count=1 -parallel=$(nproc) -timeout 30s -v ./corefunc/...
acc_terraform:
runs-on: ubuntu-latest
name: Acceptance (Terraform ${{ matrix.terraform_version }})
strategy:
fail-fast: false
matrix:
terraform_version:
- "1.0"
- "1.1"
- "1.2"
- "1.3"
- "1.4"
- "1.5"
- "1.6"
- "1.7"
- "1.8-beta1"
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
disable-sudo: true
egress-policy: block # audit
allowed-endpoints: >
api.github.com:443
checkpoint-api.hashicorp.com:443
get.opentofu.org:443
github.com:443
golang.org:443
objects.githubusercontent.com:443
proxy.golang.org:443
releases.hashicorp.com:443
storage.googleapis.com:443
- name: Checkout Source
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: ">= 1.22.1"
cache: true
- name: Install Terraform ${{ matrix.terraform_version }}
uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 # v3.0.0
with:
terraform_version: ${{ matrix.terraform_version }}
terraform_wrapper: false
- name: Run acceptance tests
env:
TF_ACC: 1
run: |
go test -run=TestAcc -count=1 -parallel=$(nproc) -timeout 30m -v ./corefuncprovider/...
acc_opentofu:
runs-on: ubuntu-latest
name: Acceptance (OpenTofu ${{ matrix.opentofu_version }})
strategy:
fail-fast: false
matrix:
opentofu_version:
- "1.6"
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
disable-sudo: true
egress-policy: block # audit
allowed-endpoints: >
api.github.com:443
checkpoint-api.hashicorp.com:443
get.opentofu.org:443
github.com:443
golang.org:443
objects.githubusercontent.com:443
proxy.golang.org:443
releases.hashicorp.com:443
storage.googleapis.com:443
- name: Checkout Source
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: ">= 1.22.1"
cache: true
- name: Install OpenTofu ${{ matrix.opentofu_version }}
uses: opentofu/setup-opentofu@da3271e0a2f8b8552a91e37cf85d03622c328ab7 # v1.0.2
with:
tofu_version: ~${{ matrix.opentofu_version }}
tofu_wrapper: false
- name: Run acceptance tests
env:
TF_ACC: 1
TF_ACC_PROVIDER_NAMESPACE: hashicorp
TF_ACC_PROVIDER_HOST: registry.opentofu.org
run: |
TF_ACC_TERRAFORM_PATH=$(which tofu) \
go test -run=TestAcc -count=1 -parallel=$(nproc) -timeout 30m -v ./corefuncprovider/...