2323 type : string
2424 default : " "
2525 description : Space-separated conda-forge specs to add to the env.
26+ cooldown :
27+ type : string
28+ default : 7d
29+ description : Ignore conda and PyPI releases newer than this age, e.g. 7d. Empty disables. uv-locked installs ignore it.
2630 pytest-args :
2731 type : string
2832 default : " "
3943 type : string
4044 default : " "
4145 description : Fail if a benchmark mean regresses by more than this percent. Empty never fails (compare mode only).
42- secret -env :
46+ vars -env :
4347 type : string
4448 default : " "
45- description : Space-separated secret or variable names to export to the job env.
49+ description : Space-separated repository or organization variable (`vars`) names to export to the job env.
4650 working-directory :
4751 type : string
4852 default : .
4953 description : Directory of the package, relative to the repo root.
54+ secrets :
55+ CDSAPI_TOKEN :
56+ required : false
57+ EARTHDATAHUB_API_KEY :
58+ required : false
59+ MSK_LICENSE :
60+ required : false
61+ GUROBI_LIC :
62+ required : false
5063
5164permissions : {}
5265
5972 outputs :
6073 legs : ${{ steps.legs.outputs.legs }}
6174 steps :
75+ - uses : step-security/harden-runner@46b06cea07f9e64621fdf066ba77ac6915163d43 # v2.22.3
76+ with :
77+ egress-policy : audit
78+ - if : github.event_name == 'pull_request_target'
79+ run : |
80+ echo "::error::pull_request_target runs fork code with secrets. Use pull_request." >&2
81+ exit 1
6282 - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
6383 with :
6484 fetch-depth : 0
@@ -92,6 +112,10 @@ jobs:
92112 matrix :
93113 include : ${{ fromJSON(needs.build.outputs.legs) }}
94114 steps :
115+ - uses : step-security/harden-runner@46b06cea07f9e64621fdf066ba77ac6915163d43 # v2.22.3
116+ if : matrix.runner != 'codspeed-macro'
117+ with :
118+ egress-policy : audit
95119 - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
96120 with :
97121 persist-credentials : false
@@ -105,15 +129,19 @@ jobs:
105129 python-version : ${{ inputs.python-version }}
106130 pixi-add : ${{ inputs.pixi-add }}
107131 extras : ${{ inputs.extras }}
132+ cooldown : ${{ inputs.cooldown }}
108133 wheel-dir : ${{ runner.temp }}/wheels
109- secrets-json : ${{ toJSON(secrets) }}
110134 vars-json : ${{ toJSON(vars) }}
111- secret -env : ${{ inputs.secret -env }}
135+ vars -env : ${{ inputs.vars -env }}
112136 working-directory : ${{ inputs.working-directory }}
113137 - uses : CodSpeedHQ/action@c4fd08a3a159bd0cc208da1e0edf32b8c47d75e5 # v5.4.0
114138 env :
115139 BENCHMARK_PATH : ${{ inputs.benchmark-path }}
116140 PYTEST_ARGS : ${{ inputs.pytest-args }}
141+ CDSAPI_TOKEN : ${{ secrets.CDSAPI_TOKEN }}
142+ EARTHDATAHUB_API_KEY : ${{ secrets.EARTHDATAHUB_API_KEY }}
143+ MSK_LICENSE : ${{ secrets.MSK_LICENSE }}
144+ GUROBI_LIC : ${{ secrets.GUROBI_LIC }}
117145 with :
118146 mode : ${{ matrix.mode }}
119147 working-directory : ${{ inputs.working-directory }}
@@ -131,6 +159,13 @@ jobs:
131159 EXTRAS : ${{ inputs.extras }}
132160 IS_PR : ${{ github.event_name == 'pull_request' }}
133161 steps :
162+ - uses : step-security/harden-runner@46b06cea07f9e64621fdf066ba77ac6915163d43 # v2.22.3
163+ with :
164+ egress-policy : audit
165+ - if : github.event_name == 'pull_request_target'
166+ run : |
167+ echo "::error::pull_request_target runs fork code with secrets. Use pull_request." >&2
168+ exit 1
134169 - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
135170 with :
136171 ref : ${{ github.event.pull_request.head.sha || github.sha }}
@@ -189,13 +224,18 @@ jobs:
189224 python-version : ${{ inputs.python-version }}
190225 pixi-add : ${{ inputs.pixi-add }}
191226 extras : ${{ inputs.extras }}
227+ cooldown : ${{ inputs.cooldown }}
192228 wheel-dir : ${{ steps.wheels.outputs.first }}
193- secrets-json : ${{ toJSON(secrets) }}
194229 vars-json : ${{ toJSON(vars) }}
195- secret -env : ${{ inputs.secret -env }}
230+ vars -env : ${{ inputs.vars -env }}
196231 working-directory : ${{ steps.base.outputs.present == 'true' && 'base' || 'head' }}/${{ inputs.working-directory }}
197232 - if : steps.base.outputs.present == 'true'
198233 working-directory : base/${{ inputs.working-directory }}
234+ env :
235+ CDSAPI_TOKEN : ${{ secrets.CDSAPI_TOKEN }}
236+ EARTHDATAHUB_API_KEY : ${{ secrets.EARTHDATAHUB_API_KEY }}
237+ MSK_LICENSE : ${{ secrets.MSK_LICENSE }}
238+ GUROBI_LIC : ${{ secrets.GUROBI_LIC }}
199239 run : |
200240 set -euo pipefail
201241 if [ -e "$BENCHMARK_PATH" ]; then
@@ -209,6 +249,11 @@ jobs:
209249 WHEEL : ${{ steps.wheels.outputs.head }}
210250 run : $RUN uv pip install --reinstall-package "$PACKAGE" "$WHEEL[$EXTRAS]"
211251 - working-directory : head/${{ inputs.working-directory }}
252+ env :
253+ CDSAPI_TOKEN : ${{ secrets.CDSAPI_TOKEN }}
254+ EARTHDATAHUB_API_KEY : ${{ secrets.EARTHDATAHUB_API_KEY }}
255+ MSK_LICENSE : ${{ secrets.MSK_LICENSE }}
256+ GUROBI_LIC : ${{ secrets.GUROBI_LIC }}
212257 run : $RUN pytest "$BENCHMARK_PATH" --benchmark-only --benchmark-json="$RUNNER_TEMP/head.json" $PYTEST_ARGS
213258 - working-directory : head/${{ inputs.working-directory }}
214259 run : |
0 commit comments