Files
chemenu/.gitea/workflows/converters.yml
T
torbenandClaude Opus 5.5 c439dc68af
CI / verify (push) Successful in 7m56s
CI / pwsh (push) Successful in 2m45s
Converters / converters (push) Successful in 8m53s
ci: converters.yml header names the grant in the private repository's Actions settings as what lets the job token read it, instead of the 1Password fallback that turned out unnecessary (#232 close)
Files changed:
- .gitea/workflows/converters.yml

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SnAJ7Z3CpVD3PRbN73QtU2
2026-10-14 16:33:33 +02:00

88 lines
3.6 KiB
YAML

# The converters against real documents.
#
# `ci.yml` proves the filters on documents built to be easy (`test_raw_derive.py`,
# `test_raw_derive_binary.py`). This workflow derives the real ones: the test corpus and its
# harness live in the private repository `torben/chemenu-testfiles`, cloned into `testfiles/`
# (gitignored in this repository) and run with this checkout's `tools/.venv`. The corpus is large
# (some 76 MB, one book needs 48 s per derivation) and holds material that may not sit in a public
# repository, which is why none of it runs in the standard CI.
#
# When it runs:
# - on a push to `main` that touches the converter surface (the `paths:` list below). Gitea
# evaluates `paths:` the way GitHub does - observed for `paths-ignore` in `ci.yml` and in use for
# `paths:` in `release.yml`; do not re-derive it;
# - by hand (`workflow_dispatch`), which is the way to run it after a change in the private
# repository alone: a push there starts nothing here, and a commit that reaches the converters
# only indirectly is not in the list;
# - before a release without suffix: `release.yml` carries the same steps as its job `converters`
# and the release job waits for it. A candidate (`-beta.N`) does not run it.
#
# It always tests `main` of the private repository. A converter change that alters an expected
# output (`.expect`) is therefore two commits, one per repository, the private one first.
#
# Runner shape: identical to ci.yml, and for the same reason - see its header for `nodejs`.
#
# Access to the private repository: the per-job token (`${{ gitea.token }}`), as `release.yml`
# uses it for this repository. It can read `chemenu-testfiles` only because that repository's own
# Actions settings grant `torben/chemenu` access - a grant set in this repository does nothing.
# Without it the second checkout fails with "Determining the default branch ... not found", which
# reads like a missing repository rather than a missing permission (Gitea #232, runs 699 and 701).
name: Converters
on:
push:
branches: [main]
paths:
- 'tools/chemenu/filters/**'
- 'tools/chemenu/commands/raw/derive.py'
- 'tools/chemenu/commands/raw/accept.py'
- 'tools/chemenu/tests/test_raw_derive*.py'
- 'tools/chemenu/tests/binary_formats.py'
- 'tools/requirements.txt'
- '.gitea/workflows/converters.yml'
workflow_dispatch:
jobs:
converters:
runs-on: linux-docker
timeout-minutes: 30
container:
image: debian:trixie-slim
env:
WIKITOOL_SESSION_ID: converters-${{ github.run_id }}
WIKI_TRACE_DIR: /tmp/wikitool-trace
steps:
- name: System dependencies
run: |
set -eu
apt-get update -qq
apt-get install -y --no-install-recommends \
python3 python3-venv git nodejs ripgrep ca-certificates
rm -rf /var/lib/apt/lists/*
- uses: actions/checkout@v7
- name: The private test corpus
uses: actions/checkout@v7
with:
repository: torben/chemenu-testfiles
token: ${{ gitea.token }}
path: testfiles
- name: Tool environment
run: |
set -eu
git config --global --add safe.directory "$GITHUB_WORKSPACE"
tools/preflight.sh
tools/.venv/bin/python -m pip install --quiet pytest
- name: Real documents
# `-c pytest.ini` applies the suite's own configuration to a harness that lives outside
# `tools/`; the harness conftest pulls in the suite's conftest (testfiles/README.md).
run: |
set -eu
cd tools
.venv/bin/python -m pytest -c pytest.ini ../testfiles/harness -q --durations=5