Repository navigation
92 lines (81 loc) · 3.12 KB
/
Copy pathself-tests.yml
File metadata and controls
92 lines (81 loc) · 3.12 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Self-tests
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
self-tests:
# The owner runs on Windows and the self-tests take both the Windows and the
# POSIX paths, so each is proved on its own runner.
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
env:
BENCHMARK_TEMPLATES: ${{ github.workspace }}/solid-ai-templates
steps:
- uses: actions/checkout@v4
with:
path: solid-ai-benchmark
# The benchmark carries no templates, so every self-test names a clone of
# them. A self-test makes no model call, so it needs no secret.
- uses: actions/checkout@v4
with:
repository: solid-ai-dev/solid-ai-templates
path: solid-ai-templates
# The arms are built from registered tags, such as the baseline's
# v2.90.0, so the clone needs its full history and tags.
fetch-depth: 0
# The interpreter every scored trial runs under.
- uses: actions/setup-python@v5
with:
python-version: "3.12"
# The self-tests commit in scratch workspaces, which needs an identity.
- name: Configure git
run: |
git config --global user.name "CI"
git config --global user.email "ci@example.invalid"
# The self-tests build a trial's command line, which resolves the agent CLIs
# on PATH, but never launch one. Stubs that refuse to run stand in for them,
# so no model can be called.
- name: Put stub agent CLIs on PATH
run: |
stubs="$RUNNER_TEMP/stub-cli"
mkdir -p "$stubs"
for cli in claude codex; do
printf '#!/bin/sh\necho "%s is a CI stub" >&2\nexit 1\n' "$cli" \
> "$stubs/$cli"
chmod +x "$stubs/$cli"
printf '@echo %s is a CI stub 1>&2\r\n@exit /b 1\r\n' "$cli" \
> "$stubs/$cli.cmd"
done
echo "$stubs" >> "$GITHUB_PATH"
- name: Install pyflakes
run: python -m pip install --disable-pip-version-check pyflakes
# Each self-test's output is kept, so the trace below can look up the
# labels the requirements name without running every self-test again.
- name: Run every self-test
working-directory: solid-ai-benchmark
run: |
set -eo pipefail
outputs="$RUNNER_TEMP/self-tests"
mkdir -p "$outputs"
for module in harness generate_arm score judge report archive reuse \
progress probes security quality control/control trace; do
echo "::group::$module"
python "tests/efficacy/$module.py" --self-test \
| tee "$outputs/$(basename "$module").txt"
echo "::endgroup::"
done
- name: Trace the requirements to the self-tests
working-directory: solid-ai-benchmark
run: python tests/efficacy/trace.py --outputs "$RUNNER_TEMP/self-tests"
- name: Pyflakes
working-directory: solid-ai-benchmark
run: python -m pyflakes tests