Skip to content

Commit 482f036

Browse files
committed
ci: relocate Nim toolchain to $RUNNER_TEMP
Adds parent-nim-install-directory: ${{ runner.temp }} to setup-nim-action in both ci.yml and docs.yml. Nim now installs to $RUNNER_TEMP/.nim_runtime/ instead of vendoring under $GITHUB_WORKSPACE/.nim_runtime/. Effects: - nph --check . works normally (no vendored Nim source tree to recurse into) - ci.yml restored to nph --check . (was: nph --check src tests workaround) - docs.yml unchanged path resolution (already used `command -v nim`) - Removes nph-scope gotcha from CLAUDE.md / AGENTS.md (no longer applicable)
1 parent 348e1db commit 482f036

4 files changed

Lines changed: 5 additions & 21 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,17 @@ jobs:
1919
- uses: jiro4989/setup-nim-action@v2
2020
with:
2121
nim-version: ${{ matrix.nim-version }}
22+
parent-nim-install-directory: ${{ runner.temp }}
2223
- uses: actions/cache@v4
2324
with:
2425
path: ~/.nimble
2526
key: nimble-${{ runner.os }}-${{ hashFiles('**/*.nimble') }}
2627
- name: nimble install deps
2728
run: nimble install --depsOnly -y
2829
- name: nph format check
29-
# Scope to project source dirs only. `nph --check .` would recurse into
30-
# `.nim_runtime/` (the Nim source tree pulled in by setup-nim-action)
31-
# and segfault on malformed test files (e.g. nimsuggest/tests/tconcept1.nim).
32-
# The pre-commit hook already operates only on tracked .nim files, so this
33-
# matches local behavior.
3430
run: |
3531
nimble install -y nph@0.7.0 # PIN: must match .pre-commit-config.yaml local nph hook
36-
nph --check src tests
32+
nph --check .
3733
continue-on-error: ${{ matrix.nim-version == 'devel' }}
3834
- name: nimble check
3935
run: nimble check

.github/workflows/docs.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ jobs:
1313
- uses: actions/setup-python@v5
1414
with: { python-version: "3.12" }
1515
- uses: jiro4989/setup-nim-action@v2
16-
with: { nim-version: stable }
16+
with:
17+
nim-version: stable
18+
parent-nim-install-directory: ${{ runner.temp }}
1719
- name: Make Nim compiler module importable
1820
# mkdocstrings-nim's extractor compiles a helper that does
1921
# `import compiler/ast` etc. The compiler module ships at

AGENTS.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,6 @@ Tests live in `tests/` and are discovered by `nimble test`.
2929
- **Formatting authority:** `nph` (pinned to v0.7.0 in pre-commit, ci.yml, and CLAUDE.md Setup).
3030
- **Pre-commit guard:** `nph` and `nimble check` on commit. No pre-push stage (Nim has no slow type-check analogue to mypy).
3131

32-
## Gotchas
33-
34-
- **CI tool scoping:** Always scope formatters/checkers to `src tests` (not `.`) —
35-
`jiro4989/setup-nim-action@v2` vendors a copy of the Nim source tree at `.nim_runtime/`
36-
containing intentionally malformed test fixtures (e.g. `nimsuggest/tests/tconcept1.nim`)
37-
that crash nph 0.7.0 with SIGSEGV.
38-
3932
## The justfile is the canonical command surface
4033

4134
`nimble` is an implementation detail. Add new dev workflows as `just` recipes,

CLAUDE.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,6 @@ The pre-commit `nph` hook, the CI `nph --check` step, and the local `just lint`/
6262
all assume the SAME nph version (currently 0.7.0). Bump in all three places together,
6363
or skew will cause "format clean locally, fails in CI" footguns.
6464

65-
### `nph --check` scope
66-
In CI (`jiro4989/setup-nim-action@v2`), the action vendors the full Nim source tree under
67-
`.nim_runtime/`. Running `nph --check .` recurses into it and crashes on
68-
`nimsuggest/tests/tconcept1.nim` (intentionally malformed; nph 0.7.0 SIGSEGVs, exit 139).
69-
The `ci.yml` here uses `nph --check src tests` for that reason. The pre-commit hook is
70-
unaffected (operates on git-tracked files only, and `.nim_runtime/` is gitignored).
71-
7265
### `mkdocstrings-nim` requires `default_handler: nim`
7366
Without `default_handler: nim` in mkdocs.yml, mkdocstrings 1.x routes documentation blocks
7467
to a non-existent `python` handler and the build fails with a confusing

0 commit comments

Comments
 (0)