@@ -21,28 +21,24 @@ jobs:
21
21
uses : cisagov/setup-env-github-action@develop
22
22
- uses : actions/checkout@v3
23
23
- id : setup-python
24
- uses : actions/setup-python@v3
24
+ uses : actions/setup-python@v4
25
25
with :
26
26
python-version : " 3.10"
27
27
# We need the Go version and Go cache location for the actions/cache step,
28
28
# so the Go installation must happen before that.
29
- - uses : actions/setup-go@v2
29
+ - id : setup-go
30
+ uses : actions/setup-go@v3
30
31
with :
31
- go-version : " 1.16"
32
- - name : Store installed Go version
33
- id : go-version
34
- run : |
35
- echo "::set-output name=version::"\
36
- "$(go version | sed 's/^go version go\([0-9.]\+\) .*/\1/')"
32
+ go-version : " 1.19"
37
33
- name : Lookup Go cache directory
38
34
id : go-cache
39
35
run : |
40
- echo "::set-output name= dir:: $(go env GOCACHE)"
36
+ echo "dir= $(go env GOCACHE)" >> $GITHUB_OUTPUT
41
37
- uses : actions/cache@v3
42
38
env :
43
39
BASE_CACHE_KEY : " ${{ github.job }}-${{ runner.os }}-\
44
40
py${{ steps.setup-python.outputs.python-version }}-\
45
- go${{ steps.go-version .outputs.version }}-\
41
+ go${{ steps.setup-go .outputs.go- version }}-\
46
42
packer${{ steps.setup-env.outputs.packer-version }}-\
47
43
tf${{ steps.setup-env.outputs.terraform-version }}-"
48
44
with :
82
78
${{ env.CURL_CACHE_DIR }}/"${PACKER_ZIP}"
83
79
sudo mv /usr/local/bin/packer /usr/local/bin/packer-default
84
80
sudo ln -s /opt/packer/packer /usr/local/bin/packer
85
- - uses : hashicorp/setup-terraform@v1
81
+ - uses : hashicorp/setup-terraform@v2
86
82
with :
87
83
terraform_version : ${{ steps.setup-env.outputs.terraform-version }}
88
84
- name : Install shfmt
@@ -107,20 +103,26 @@ jobs:
107
103
uses : mxschmitt/action-tmate@v3
108
104
if : env.RUN_TMATE
109
105
test :
110
- runs-on : ubuntu-latest
106
+ name : test source - py${{ matrix.python-version }}
107
+ runs-on : ${{ matrix.os }}
111
108
strategy :
112
109
fail-fast : false
113
110
matrix :
111
+ os :
112
+ - ubuntu-latest
114
113
python-version :
115
114
- " 3.7"
116
115
- " 3.8"
117
116
- " 3.9"
118
117
- " 3.10"
119
118
- " 3.11"
119
+ include :
120
+ - os : ubuntu-20.04
121
+ python-version : " 3.6"
120
122
steps :
121
123
- uses : actions/checkout@v3
122
124
- id : setup-python
123
- uses : actions/setup-python@v3
125
+ uses : actions/setup-python@v4
124
126
with :
125
127
python-version : ${{ matrix.python-version }}
126
128
- uses : actions/cache@v3
@@ -159,11 +161,12 @@ jobs:
159
161
if : env.RUN_TMATE
160
162
coveralls-finish :
161
163
runs-on : ubuntu-latest
162
- needs : test
164
+ needs :
165
+ - test
163
166
steps :
164
167
- uses : actions/checkout@v3
165
168
- id : setup-python
166
- uses : actions/setup-python@v3
169
+ uses : actions/setup-python@v4
167
170
with :
168
171
python-version : " 3.10"
169
172
- uses : actions/cache@v3
@@ -193,21 +196,29 @@ jobs:
193
196
uses : mxschmitt/action-tmate@v3
194
197
if : env.RUN_TMATE
195
198
build :
196
- runs-on : ubuntu-latest
197
- needs : [lint, test]
199
+ name : build wheel - py${{ matrix.python-version }}
200
+ needs :
201
+ - lint
202
+ - test
203
+ runs-on : ${{ matrix.os }}
198
204
strategy :
199
205
fail-fast : false
200
206
matrix :
207
+ os :
208
+ - ubuntu-latest
201
209
python-version :
202
210
- " 3.7"
203
211
- " 3.8"
204
212
- " 3.9"
205
213
- " 3.10"
206
214
- " 3.11"
215
+ include :
216
+ - os : ubuntu-20.04
217
+ python-version : " 3.6"
207
218
steps :
208
219
- uses : actions/checkout@v3
209
220
- id : setup-python
210
- uses : actions/setup-python@v3
221
+ uses : actions/setup-python@v4
211
222
with :
212
223
python-version : ${{ matrix.python-version }}
213
224
- uses : actions/cache@v3
@@ -231,10 +242,68 @@ jobs:
231
242
- name : Build artifacts
232
243
run : python -m build
233
244
- name : Upload artifacts
234
- uses : actions/upload-artifact@v2
245
+ uses : actions/upload-artifact@v3
235
246
with :
236
247
name : dist-${{ matrix.python-version }}
237
248
path : dist
238
249
- name : Setup tmate debug session
239
250
uses : mxschmitt/action-tmate@v3
240
251
if : env.RUN_TMATE
252
+ test-build :
253
+ name : test built wheel - py${{ matrix.python-version }}
254
+ needs :
255
+ - build
256
+ runs-on : ${{ matrix.os }}
257
+ strategy :
258
+ fail-fast : false
259
+ matrix :
260
+ os :
261
+ - ubuntu-latest
262
+ python-version :
263
+ - " 3.7"
264
+ - " 3.8"
265
+ - " 3.9"
266
+ - " 3.10"
267
+ - " 3.11"
268
+ include :
269
+ - os : ubuntu-20.04
270
+ python-version : " 3.6"
271
+ steps :
272
+ - uses : actions/checkout@v3
273
+ - id : setup-python
274
+ uses : actions/setup-python@v4
275
+ with :
276
+ python-version : ${{ matrix.python-version }}
277
+ - uses : actions/cache@v3
278
+ env :
279
+ BASE_CACHE_KEY : " ${{ github.job }}-${{ runner.os }}-\
280
+ py${{ steps.setup-python.outputs.python-version }}-"
281
+ with :
282
+ path : ${{ env.PIP_CACHE_DIR }}
283
+ # We do not use '**/setup.py' in the cache key so only the 'setup.py'
284
+ # file in the root of the repository is used. This is in case a Python
285
+ # package were to have a 'setup.py' as part of its internal codebase.
286
+ key : " ${{ env.BASE_CACHE_KEY }}\
287
+ ${{ hashFiles('**/requirements.txt') }}-\
288
+ ${{ hashFiles('setup.py') }}"
289
+ restore-keys : |
290
+ ${{ env.BASE_CACHE_KEY }}
291
+ - name : Retrieve the built wheel
292
+ uses : actions/download-artifact@v3
293
+ with :
294
+ name : dist-${{ matrix.python-version }}
295
+ path : dist
296
+ - id : find-wheel
297
+ name : Get the name of the retrieved wheel (there should only be one)
298
+ run : echo "wheel=$(ls dist/*whl)" >> $GITHUB_OUTPUT
299
+ - name : Update core Python packages
300
+ run : python -m pip install --upgrade pip setuptools wheel
301
+ - name : Install the built wheel (along with testing dependencies)
302
+ run : python -m pip install ${{ steps.find-wheel.outputs.wheel }}[test]
303
+ - name : Run tests
304
+ env :
305
+ RELEASE_TAG : ${{ github.event.release.tag_name }}
306
+ run : pytest
307
+ - name : Setup tmate debug session
308
+ uses : mxschmitt/action-tmate@v3
309
+ if : env.RUN_TMATE
0 commit comments