Workflows use Node 24–native action versions (actions/checkout@v5, astral-sh/setup-uv@v8.1.0, actions/cache@v5, actions/upload-artifact@v6, actions/deploy-pages@v5, etc.) so CI does not rely on the deprecated Node 20 runtime or FORCE_JAVASCRIPT_ACTIONS_TO_NODE24.
| Workflow | File | When it runs | Purpose |
|---|---|---|---|
| CI | .github/workflows/ci.yml |
Every push/PR to master/main |
Gitleaks secret scan + pytest with ≥95% coverage (no ML download); checks out sibling ner-dataset |
| Benchmark → Pages | .github/workflows/benchmark-pages.yml |
Push to master, manual |
Full benchmark + publish report.html |
Hardcoded API keys and tokens are blocked by Gitleaks:
| Where | When |
|---|---|
CI job secrets |
Every push/PR (OSS gitleaks detect CLI, full git history) |
pre-commit hook gitleaks |
Staged files before each commit (after pre-commit install) |
Config: .gitleaks.toml (extends default rules; allowlists tests/, .env.example, docs).
gitleaks detect --source . --config .gitleaks.toml --verbose
Keep real keys only in local .env (gitignored). CI uses the free Gitleaks binary (not gitleaks-action, which can require a paid org license).
The benchmark job always succeeds independently. The deploy job needs Pages turned on in the repo.
After a successful deploy, the URL appears under Settings → Pages and in the github-pages environment summary.
| Situation | What to do |
|---|---|
| Deploy fails with 404 / Ensure GitHub Pages has been enabled | Pages is not enabled yet — complete steps 1–3 above. |
| Pages enabled but still 404 | Your org/account may need GitHub Team, Enterprise, or Pro for Pages on private repos. Check org billing/features. |
| No Pages on your plan | Set variable BENCHMARK_DEPLOY_PAGES = false (see below). Download ner-benchmark-report from the workflow run Artifacts (repo members only). |
| Public report for everyone | Make the repo public, enable Pages, or publish the artifact elsewhere. |
Who can view a private Pages site: usually org members / collaborators with repo access, not the whole internet (unless you set Pages visibility to public where your plan allows it).
See .github/workflows/benchmark-pages.yml. Configure it via repository variables and secrets below (Settings → Secrets and variables → Actions).
vars)Set under Settings → Secrets and variables → Actions → Variables (repository scope).
| Variable | Default if unset | Description |
|---|---|---|
BENCHMARK_REPEATS |
1 |
Trials per backend×dataset (--repeats) |
BENCHMARK_MAX_EXAMPLES |
(empty) | Cap examples per dataset (--max-examples) |
BENCHMARK_PATTERN_ONLY |
false |
true → only run pattern backend |
BENCHMARK_DATASETS |
(empty) | Comma-separated dataset names (--datasets) |
BENCHMARK_RUNS |
(empty) | Comma-separated run names (--runs) |
TRANSFORMERS_VERBOSITY |
error |
Passed to the benchmark job environment |
BENCHMARK_OUTPUT_DIR |
benchmark/results/latest |
Fixed output directory for the published report |
BENCHMARK_DEPLOY_PAGES |
true |
Set to false to skip GitHub Pages deploy (artifact upload still runs) |
CI tip: use BENCHMARK_REPEATS=1 on GitHub-hosted runners. For latency variance locally, pass --repeats 5.
Gold JSONL files are loaded from the checked-out ner-dataset repo (NER_DATASET_DIR=ner-dataset/datasets in workflows). Clone both repos side by side locally, or set NER_DATASET_DIR to your gold folder.
Actions → latest Benchmark report (Pages) run → Artifacts → ner-benchmark-report → open report.html locally.
Set under Settings → Secrets and variables → Actions → Secrets (repository scope).
| Secret | Required | Description |
|---|---|---|
OPENROUTER_API_KEY |
No* | OpenRouter API key for LLM benchmark runs (llm-gpt-oss, etc.). Omit or use BENCHMARK_PATTERN_ONLY=true for pattern-only reports. |
HF_TOKEN |
No | Hugging Face token for gated models or higher download rate limits |
*Required only when the benchmark config includes live OpenRouter backends and BENCHMARK_PATTERN_ONLY is not true. The workflow passes these to the job environment (see .github/workflows/benchmark-pages.yml).
Local parity uses .env instead — see configuration.md and .env.example.
The benchmark deploy job requests:
pages: writeid-token: writeIf deploy fails with permissions errors: Settings → Actions → General → Workflow permissions → allow read/write for workflows (or use the default GITHUB_TOKEN scope your org allows).
master (CI runs automatically).master or Run workflow).| Repo visibility | Typical audience |
|---|---|
| Private | Org members / collaborators with repo access |
| Public | Anyone with the Pages URL |
After Pages works, add to README.md:
**[Latest benchmark report](https://marfago-labs.github.io/ner-detector/)** *(update URL from Settings → Pages)*
Actions → Benchmark report (Pages) → Run workflow (uses current variables/secrets).
uv sync --extra dev --extra ml --extra gliner
uv run python benchmark/run_benchmark.py --repeats 1 --output benchmark/results/latest
See benchmarks.md for metrics and interpretation.