1414 RUN_TMATE : ${{ secrets.RUN_TMATE }}
1515
1616jobs :
17+ diagnostics :
18+ name : Run diagnostics
19+ runs-on : ubuntu-latest
20+ steps :
21+ # Note that a duplicate of this step must be added at the top of
22+ # each job.
23+ - id : harden-runner
24+ name : Harden the runner
25+ uses : step-security/harden-runner@v2
26+ with :
27+ egress-policy : audit
28+ - id : github-status
29+ name : Check GitHub status
30+ uses : crazy-max/ghaction-github-status@v3
31+ - id : dump-context
32+ name : Dump context
33+ uses : crazy-max/ghaction-dump-context@v2
1734 lint :
35+ needs :
36+ - diagnostics
1837 runs-on : ubuntu-latest
1938 steps :
39+ - id : harden-runner
40+ name : Harden the runner
41+ uses : step-security/harden-runner@v2
42+ with :
43+ egress-policy : audit
2044 - id : setup-env
2145 uses : cisagov/setup-env-github-action@develop
22- - uses : actions/checkout@v3
46+ - uses : actions/checkout@v4
2347 - id : setup-python
2448 uses : actions/setup-python@v4
2549 with :
@@ -84,11 +108,26 @@ jobs:
84108 - uses : hashicorp/setup-terraform@v2
85109 with :
86110 terraform_version : ${{ steps.setup-env.outputs.terraform-version }}
111+ - name : Install go-critic
112+ env :
113+ PACKAGE_URL : github.com/go-critic/go-critic/cmd/gocritic
114+ PACKAGE_VERSION : ${{ steps.setup-env.outputs.go-critic-version }}
115+ run : go install ${PACKAGE_URL}@${PACKAGE_VERSION}
116+ - name : Install gosec
117+ env :
118+ PACKAGE_URL : github.com/securego/gosec/v2/cmd/gosec
119+ PACKAGE_VERSION : ${{ steps.setup-env.outputs.gosec-version }}
120+ run : go install ${PACKAGE_URL}@${PACKAGE_VERSION}
87121 - name : Install shfmt
88122 env :
89123 PACKAGE_URL : mvdan.cc/sh/v3/cmd/shfmt
90124 PACKAGE_VERSION : ${{ steps.setup-env.outputs.shfmt-version }}
91125 run : go install ${PACKAGE_URL}@${PACKAGE_VERSION}
126+ - name : Install staticcheck
127+ env :
128+ PACKAGE_URL : honnef.co/go/tools/cmd/staticcheck
129+ PACKAGE_VERSION : ${{ steps.setup-env.outputs.staticcheck-version }}
130+ run : go install ${PACKAGE_URL}@${PACKAGE_VERSION}
92131 - name : Install Terraform-docs
93132 env :
94133 PACKAGE_URL : github.com/terraform-docs/terraform-docs
@@ -107,6 +146,8 @@ jobs:
107146 if : env.RUN_TMATE
108147 test :
109148 name : test source - py${{ matrix.python-version }}
149+ needs :
150+ - diagnostics
110151 runs-on : ${{ matrix.os }}
111152 strategy :
112153 fail-fast : false
@@ -119,11 +160,17 @@ jobs:
119160 - " 3.9"
120161 - " 3.10"
121162 - " 3.11"
163+ - " 3.12"
122164 include :
123165 - os : ubuntu-20.04
124166 python-version : " 3.6"
125167 steps :
126- - uses : actions/checkout@v3
168+ - id : harden-runner
169+ name : Harden the runner
170+ uses : step-security/harden-runner@v2
171+ with :
172+ egress-policy : audit
173+ - uses : actions/checkout@v4
127174 - id : setup-python
128175 uses : actions/setup-python@v4
129176 with :
@@ -165,9 +212,15 @@ jobs:
165212 coveralls-finish :
166213 runs-on : ubuntu-latest
167214 needs :
215+ - diagnostics
168216 - test
169217 steps :
170- - uses : actions/checkout@v3
218+ - id : harden-runner
219+ name : Harden the runner
220+ uses : step-security/harden-runner@v2
221+ with :
222+ egress-policy : audit
223+ - uses : actions/checkout@v4
171224 - id : setup-python
172225 uses : actions/setup-python@v4
173226 with :
@@ -201,6 +254,7 @@ jobs:
201254 build :
202255 name : build wheel - py${{ matrix.python-version }}
203256 needs :
257+ - diagnostics
204258 - lint
205259 - test
206260 runs-on : ${{ matrix.os }}
@@ -215,11 +269,17 @@ jobs:
215269 - " 3.9"
216270 - " 3.10"
217271 - " 3.11"
272+ - " 3.12"
218273 include :
219274 - os : ubuntu-20.04
220275 python-version : " 3.6"
221276 steps :
222- - uses : actions/checkout@v3
277+ - id : harden-runner
278+ name : Harden the runner
279+ uses : step-security/harden-runner@v2
280+ with :
281+ egress-policy : audit
282+ - uses : actions/checkout@v4
223283 - id : setup-python
224284 uses : actions/setup-python@v4
225285 with :
@@ -255,6 +315,7 @@ jobs:
255315 test-build :
256316 name : test built wheel - py${{ matrix.python-version }}
257317 needs :
318+ - diagnostics
258319 - build
259320 runs-on : ${{ matrix.os }}
260321 strategy :
@@ -268,11 +329,17 @@ jobs:
268329 - " 3.9"
269330 - " 3.10"
270331 - " 3.11"
332+ - " 3.12"
271333 include :
272334 - os : ubuntu-20.04
273335 python-version : " 3.6"
274336 steps :
275- - uses : actions/checkout@v3
337+ - id : harden-runner
338+ name : Harden the runner
339+ uses : step-security/harden-runner@v2
340+ with :
341+ egress-policy : audit
342+ - uses : actions/checkout@v4
276343 - id : setup-python
277344 uses : actions/setup-python@v4
278345 with :
0 commit comments