record-manager-solved/.forgejo/workflows/grade.yml
trevon fd16288f45
Some checks failed
grade / grade (push) Failing after 4s
verdict breakdown
2026-08-26 01:57:00 +00:00

29 lines
1.7 KiB
YAML

name: grade
on: [push]
# Production wiring (forgejo-runner on ghost):
# - forgejo-runner v13 config: docker_host: automount -> the job container
# gets the host docker socket, so `docker run` drives the host daemon
# - the nested grade container mounts the secret + hidden tests straight from
# the host (/opt/grade/grade.env, /opt/grade-hidden/...) — never in this
# repo, no job-container options, no Actions secrets required
jobs:
grade:
runs-on: docker
container:
image: gitea/runner-images:ubuntu-22.04
steps:
- uses: https://data.forgejo.org/actions/checkout@v6
- name: Probe workspace
run: |
{ echo "PWD=$PWD"; echo "WS=${GITHUB_WORKSPACE:-unset}"; ls -la /workspace 2>&1 | head -20; ls -la /workspace/*/ 2>/dev/null | head -20; } > /workspace/PROBE.txt 2>&1 || echo "cannot write workspace" > /workspace/PROBE.txt
- name: Grade (blank fails, solved passes)
run: |
docker run --rm --network=none \
-v "$PWD":/work \
-v /opt/grade/grade.env:/run/secrets/grade.env:ro \
-v /opt/grade-hidden/cs2060/record-manager:/hidden:ro \
-v /opt/grade/runner-diag:/diag \
grade-c:dev \
sh -c 'set -a; . /run/secrets/grade.env; set +a; { echo "SECRET_LEN=${#GRADE_HMAC_SECRET}"; python3 /opt/grade/grade_cli.py run --student /work --hidden /hidden --course CS2060 --assignment record-manager --out /work/results.json; python3 -c 'import json; d=json.load(open("/work/results.json")); r=d["result"]; print("VERDICT ok=", r["ok"], "public=", r["tests"]["public"], "hidden=", r["tests"]["hidden"])'; } 2>&1 | tee /diag/latest.log'
echo "job-step exit=$?"