Repository navigation
Expand file tree
/
Copy pathaction.yml
More file actions
56 lines (56 loc) · 1.79 KB
/
Copy pathaction.yml
File metadata and controls
56 lines (56 loc) · 1.79 KB
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
name: "punchmark gate"
description: >-
Fail CI when a punchmark fitted model's calibrated operating point moved without a
declared detector-version or spec-MAJOR bump. Consumes serialized artifacts only;
makes no statement about model weights or model quality.
branding:
icon: "shield"
color: "gray-dark"
inputs:
model:
description: "Path to the .pmk-model.json fitted-model file to gate"
required: true
baseline:
description: "Path to the committed gate-baseline/v1 operating_point.json"
required: true
rulings:
description: "Optional ruling store to chain-verify"
required: false
default: ""
version:
description: "punchmark version to install from PyPI; empty installs from the action checkout"
required: false
default: ""
runs:
using: "composite"
steps:
- uses: actions/setup-python@v7
with:
python-version: "3.12"
# Inputs reach the shell through the environment, never by string
# interpolation into the script: a path containing a space or a shell
# metacharacter must stay one argument.
- name: Install punchmark
shell: bash
env:
PUNCHMARK_VERSION: ${{ inputs.version }}
ACTION_PATH: ${{ github.action_path }}
run: |
if [ -n "$PUNCHMARK_VERSION" ]; then
pip install "punchmark==$PUNCHMARK_VERSION"
else
pip install "$ACTION_PATH"
fi
- name: Run punchmark gate
shell: bash
env:
MODEL: ${{ inputs.model }}
BASELINE: ${{ inputs.baseline }}
RULINGS: ${{ inputs.rulings }}
run: |
if [ -n "$RULINGS" ]; then
punchmark gate "$MODEL" --baseline "$BASELINE" \
--require-chain-valid --rulings "$RULINGS"
else
punchmark gate "$MODEL" --baseline "$BASELINE"
fi