Repository navigation
60 lines (57 loc) · 2.17 KB
/
Copy pathci.yml
File metadata and controls
60 lines (57 loc) · 2.17 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
# HonorCode CI: unit tests + end-to-end CLI smoke test on every push/PR.
name: ci
on:
push:
branches: [main]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Run test suite
run: python -m unittest discover -s tests -v
demo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: CLI smoke test (build, check, calibrate, batch, serve)
run: |
set -euo pipefail
python -m honorcode.cli build \
samples/student_a_baseline1.txt \
samples/student_a_baseline2.txt \
samples/student_a_baseline3.txt \
-o /tmp/base.json --student student_a
python -m honorcode.cli check /tmp/base.json \
samples/student_a_homework_genuine.txt | grep -q CONSISTENT
python -m honorcode.cli check /tmp/base.json \
samples/student_a_homework_suspect.txt | grep -q CONVERSATION
python -m honorcode.cli calibrate \
--samples samples/student_a_baseline1.txt \
samples/student_a_baseline2.txt \
samples/student_a_baseline3.txt \
--suspect samples/student_a_homework_suspect.txt \
--student student_a -o /tmp/thresholds.json
python -m honorcode.cli batch /tmp/base.json \
samples/student_a_homework_genuine.txt \
samples/student_a_homework_suspect.txt \
-o /tmp/results.csv --thresholds /tmp/thresholds.json
test "$(wc -l < /tmp/results.csv)" = "3"
(python -m honorcode.cli serve --port 8765 &>/tmp/serve.log & echo $! > /tmp/serve.pid)
for i in $(seq 1 20); do
curl -sf http://127.0.0.1:8765/ -o /dev/null && break
sleep 1
done
curl -sf http://127.0.0.1:8765/ | grep -q HonorCode
kill "$(cat /tmp/serve.pid)"