@@ -21,28 +21,24 @@ jobs:
2121 uses : cisagov/setup-env-github-action@develop
2222 - uses : actions/checkout@v3
2323 - id : setup-python
24- uses : actions/setup-python@v3
24+ uses : actions/setup-python@v4
2525 with :
2626 python-version : " 3.10"
2727 # We need the Go version and Go cache location for the actions/cache step,
2828 # so the Go installation must happen before that.
29- - uses : actions/setup-go@v2
29+ - id : setup-go
30+ uses : actions/setup-go@v3
3031 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"
3733 - name : Lookup Go cache directory
3834 id : go-cache
3935 run : |
40- echo "::set-output name= dir:: $(go env GOCACHE)"
36+ echo "dir= $(go env GOCACHE)" >> $GITHUB_OUTPUT
4137 - uses : actions/cache@v3
4238 env :
4339 BASE_CACHE_KEY : " ${{ github.job }}-${{ runner.os }}-\
4440 py${{ steps.setup-python.outputs.python-version }}-\
45- go${{ steps.go-version .outputs.version }}-\
41+ go${{ steps.setup-go .outputs.go- version }}-\
4642 packer${{ steps.setup-env.outputs.packer-version }}-\
4743 tf${{ steps.setup-env.outputs.terraform-version }}-"
4844 with :
8278 ${{ env.CURL_CACHE_DIR }}/"${PACKER_ZIP}"
8379 sudo mv /usr/local/bin/packer /usr/local/bin/packer-default
8480 sudo ln -s /opt/packer/packer /usr/local/bin/packer
85- - uses : hashicorp/setup-terraform@v1
81+ - uses : hashicorp/setup-terraform@v2
8682 with :
8783 terraform_version : ${{ steps.setup-env.outputs.terraform-version }}
8884 - name : Install shfmt
@@ -107,20 +103,26 @@ jobs:
107103 uses : mxschmitt/action-tmate@v3
108104 if : env.RUN_TMATE
109105 test :
110- runs-on : ubuntu-latest
106+ name : test source - py${{ matrix.python-version }}
107+ runs-on : ${{ matrix.os }}
111108 strategy :
112109 fail-fast : false
113110 matrix :
111+ os :
112+ - ubuntu-latest
114113 python-version :
115114 - " 3.7"
116115 - " 3.8"
117116 - " 3.9"
118117 - " 3.10"
119118 - " 3.11"
119+ include :
120+ - os : ubuntu-20.04
121+ python-version : " 3.6"
120122 steps :
121123 - uses : actions/checkout@v3
122124 - id : setup-python
123- uses : actions/setup-python@v3
125+ uses : actions/setup-python@v4
124126 with :
125127 python-version : ${{ matrix.python-version }}
126128 - uses : actions/cache@v3
@@ -159,11 +161,12 @@ jobs:
159161 if : env.RUN_TMATE
160162 coveralls-finish :
161163 runs-on : ubuntu-latest
162- needs : test
164+ needs :
165+ - test
163166 steps :
164167 - uses : actions/checkout@v3
165168 - id : setup-python
166- uses : actions/setup-python@v3
169+ uses : actions/setup-python@v4
167170 with :
168171 python-version : " 3.10"
169172 - uses : actions/cache@v3
@@ -193,21 +196,29 @@ jobs:
193196 uses : mxschmitt/action-tmate@v3
194197 if : env.RUN_TMATE
195198 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 }}
198204 strategy :
199205 fail-fast : false
200206 matrix :
207+ os :
208+ - ubuntu-latest
201209 python-version :
202210 - " 3.7"
203211 - " 3.8"
204212 - " 3.9"
205213 - " 3.10"
206214 - " 3.11"
215+ include :
216+ - os : ubuntu-20.04
217+ python-version : " 3.6"
207218 steps :
208219 - uses : actions/checkout@v3
209220 - id : setup-python
210- uses : actions/setup-python@v3
221+ uses : actions/setup-python@v4
211222 with :
212223 python-version : ${{ matrix.python-version }}
213224 - uses : actions/cache@v3
@@ -231,10 +242,68 @@ jobs:
231242 - name : Build artifacts
232243 run : python -m build
233244 - name : Upload artifacts
234- uses : actions/upload-artifact@v2
245+ uses : actions/upload-artifact@v3
235246 with :
236247 name : dist-${{ matrix.python-version }}
237248 path : dist
238249 - name : Setup tmate debug session
239250 uses : mxschmitt/action-tmate@v3
240251 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