Skip to content

build(deps): bump actions/setup-python from 5 to 6 (#2) #9

build(deps): bump actions/setup-python from 5 to 6 (#2)

build(deps): bump actions/setup-python from 5 to 6 (#2) #9

Workflow file for this run

name: Docs
on:
push:
branches: [main]
permissions:
contents: write
pages: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v6
with: { python-version: "3.12" }
- uses: jiro4989/setup-nim-action@v2
with:
nim-version: stable
parent-nim-install-directory: ${{ runner.temp }}
- name: Make Nim compiler module importable
# mkdocstrings-nim's extractor compiles a helper that does
# `import compiler/ast` etc. The compiler module ships at
# `<nim_install>/compiler/`, but Nim's default search path only
# includes `<nim_install>/lib/...`. `nimble install -y compiler`
# is a no-op against jiro4989/setup-nim-action's binary install
# (the `compiler` package was renamed to `nim` and the alias short-
# circuits when a nim binary is already present). Instead, write a
# user-level nim.cfg that adds the install root to the search path,
# making `compiler/ast` resolvable for every subsequent `nim c`.
run: |
NIM_ROOT="$(dirname "$(dirname "$(command -v nim)")")"
mkdir -p "$HOME/.config/nim"
echo "--path:\"$NIM_ROOT\"" >> "$HOME/.config/nim/nim.cfg"
echo "Added $NIM_ROOT to nim search path"
echo 'import compiler/ast; echo "compiler/ast resolves OK"' > /tmp/compiler_check.nim
nim c -r /tmp/compiler_check.nim
- name: Install mkdocs (nim variant)
run: pip install mkdocs-material mkdocstrings-nim
- name: Build
run: mkdocs build --strict
- name: Deploy to gh-pages
run: mkdocs gh-deploy --force