@@ -50,25 +50,45 @@ jobs:
5050 TOLERANCE : ${{ github.event.inputs.tolerance || '-0.03' }}
5151
5252 steps :
53+ - name : Check that the eval secrets are configured
54+ id : secrets
55+ # The eval gate needs a database and an API key. Until those secrets
56+ # exist the whole job is skipped with an explanatory notice rather than
57+ # failing — a workflow that goes red because an optional secret is
58+ # missing is a workflow people learn to ignore, and this one is meant
59+ # to be trusted enough to block a merge.
60+ run : |
61+ if [ -z "${{ secrets.EVAL_DATABASE_URL }}" ] || [ -z "${{ secrets.OPENAI_API_KEY }}" ]; then
62+ echo "configured=false" >> "$GITHUB_OUTPUT"
63+ echo "::notice title=Eval gate skipped::Set the EVAL_DATABASE_URL and OPENAI_API_KEY repository secrets to enable it. See the README."
64+ else
65+ echo "configured=true" >> "$GITHUB_OUTPUT"
66+ fi
67+
5368 - uses : actions/checkout@v4
69+ if : steps.secrets.outputs.configured == 'true'
5470 with :
5571 # compare.py reads the branch name from git, so it needs real refs.
5672 fetch-depth : 0
5773
5874 - uses : actions/setup-python@v5
75+ if : steps.secrets.outputs.configured == 'true'
5976 with :
6077 python-version : " 3.12"
6178 cache : pip
6279
6380 - name : Install dependencies
81+ if : steps.secrets.outputs.configured == 'true'
6482 run : |
6583 python -m pip install --upgrade pip
6684 pip install -r requirements.txt
6785
6886 - name : Migrate
87+ if : steps.secrets.outputs.configured == 'true'
6988 run : alembic upgrade head
7089
7190 - name : Run evals
91+ if : steps.secrets.outputs.configured == 'true'
7292 # The corpus is assumed already ingested into the shared eval database.
7393 # Re-ingesting on every PR would cost more than the eval itself and add
7494 # embedding drift as a confounder — the corpus is a fixture, not part of
82102 --notes "PR #${{ github.event.pull_request.number }}"
83103
84104 - name : Compare against main
105+ if : steps.secrets.outputs.configured == 'true'
85106 id : compare
86107 run : |
87108 python -m app.evals.compare \
91112 | tee evals/out/comparison.txt
92113
93114 - name : Comment the results on the PR
94- if : always() && github.event_name == 'pull_request'
115+ if : always() && steps.secrets.outputs.configured == 'true' && github.event_name == 'pull_request'
95116 uses : actions/github-script@v7
96117 with :
97118 script : |
@@ -116,7 +137,7 @@ jobs:
116137 });
117138
118139 - name : Upload artefacts
119- if : always()
140+ if : always() && steps.secrets.outputs.configured == 'true'
120141 uses : actions/upload-artifact@v4
121142 with :
122143 name : eval-run-${{ github.run_id }}
0 commit comments