-
Notifications
You must be signed in to change notification settings - Fork 8
229 lines (199 loc) · 5.29 KB
/
check.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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
name: Check
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
id: go
- name: Install terraform
run: wget https://releases.hashicorp.com/terraform/1.2.2/terraform_1.2.2_linux_amd64.zip -O /tmp/terraform.zip && sudo unzip -o -d /usr/local/bin/ /tmp/terraform.zip
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/[email protected]
with:
version: v1.50
- name: Get dependencies
run: go get -v -t -d ./...
- name: Test
run: go test -v -cover -coverprofile=coverage.txt ./...
- name: Coverage
uses: codecov/codecov-action@v3
with:
files: ./coverage.txt
- name: Build a snapshot with GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
args: build --snapshot
pre012:
name: pre012
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
id: go
- name: Install terraform
run: wget https://releases.hashicorp.com/terraform/0.11.15/terraform_0.11.15_linux_amd64.zip -O /tmp/terraform.zip && sudo unzip -o -d /usr/local/bin/ /tmp/terraform.zip
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Get dependencies
run: go get -v -t -d ./...
- name: Test
run: go test -v -cover -coverprofile=coverage.txt ./...
- name: Coverage
uses: codecov/codecov-action@v3
with:
files: ./coverage.txt
terraform_version_compatibility:
name: Terraform compatibility
runs-on: ubuntu-latest
strategy:
matrix:
terraform:
- 0.10.1
- 0.10.2
- 0.10.3
- 0.10.4
- 0.10.5
- 0.10.6
- 0.10.7
- 0.10.8
- 0.11.0
- 0.11.1
- 0.11.2
- 0.11.3
- 0.11.4
- 0.11.5
- 0.11.6
- 0.11.7
- 0.11.8
- 0.11.9
- 0.11.10
- 0.11.11
- 0.11.12
- 0.11.13
- 0.11.14
- 0.11.15
- 0.12.0
- 0.12.1
- 0.12.2
- 0.12.3
- 0.12.4
- 0.12.5
- 0.12.6
- 0.12.7
- 0.12.8
- 0.12.9
- 0.12.10
- 0.12.11
- 0.12.12
- 0.12.13
- 0.12.14
- 0.12.15
- 0.12.16
- 0.12.17
- 0.12.18
- 0.12.19
- 0.12.10
- 0.12.21
- 0.12.22
- 0.12.23
- 0.12.24
- 0.12.25
- 0.12.26
- 0.12.27
- 0.12.28
- 0.12.29
- 0.12.30
- 0.12.31
- 0.13.0
- 0.13.1
- 0.13.2
- 0.13.3
- 0.13.4
- 0.13.5
- 0.13.6
- 0.13.7
- 0.14.0
- 0.14.1
- 0.14.2
- 0.14.3
- 0.14.4
- 0.14.5
- 0.14.6
- 0.14.7
- 0.14.8
- 0.14.9
- 0.14.10
- 0.14.11
- 0.15.0
- 0.15.1
- 0.15.2
- 0.15.3
- 0.15.4
- 0.15.5
- 1.0.0
- 1.0.1
- 1.0.2
- 1.0.3
- 1.0.4
- 1.0.5
- 1.0.6
- 1.0.7
- 1.0.8
- 1.0.9
- 1.0.10
- 1.0.11
- 1.1.0
- 1.1.1
- 1.1.2
- 1.1.3
- 1.1.4
- 1.1.5
- 1.1.6
- 1.1.7
- 1.1.8
- 1.1.9
- 1.2.0
- 1.2.1
- 1.2.2
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
id: go
- name: Install terraform
run: wget https://releases.hashicorp.com/terraform/${{ matrix.terraform }}/terraform_${{ matrix.terraform }}_linux_amd64.zip -O /tmp/terraform.zip && sudo unzip -o -d /usr/local/bin/ /tmp/terraform.zip
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Get dependencies
run: go get -v -t -d ./...
# Making a special case for old versions of terraform, to ignore a revoked
# GPG key from Hashicorp that is trusted by old versions of terraform.
# https://discuss.hashicorp.com/t/terraform-updates-for-hcsec-2021-12/23570
- name: Test
run: |
case ${{ matrix.terraform }} in
# For the old versions of terraform that are patched, run the tests as normal.
0.11.15 | 0.12.31 | 0.13.7 )
go test -v ./...
;;
# For the old unpatched versions, skip verifying plugins in the init step.
0.10.* | 0.11.* | 0.12.* | 0.13.* )
TF_CLI_ARGS_init="-verify-plugins=false" go test -v ./...
;;
# For all other versions, run the tests as normal.
* )
go test -v ./...
;;
esac
- name: Build
run: go build -v .