ci: add Justfile + lint gate (markdown/shell/yaml/actions)
Mirror the homeserver repo's lint setup. Add a `Justfile` with lint-md/lint-sh/lint-yaml/lint-actions recipes (and a `lint` aggregate + fix recipes), an `.github`-style `.markdownlint.json`, and a `lint` job in ci.yaml that runs `just lint` on the plain runner and gates the Gentoo `build` job via `needs: lint`. The overlay has no custom runner labels (workflows use ubuntu-latest), so lint-actions calls actionlint without a -config-file, and no .github/actionlint.yaml is needed. Also add the blank line before a list in CLAUDE.md that markdownlint (MD032) flagged, and make the .markdownlint.json referenced by .yamllint.yaml's comment actually exist. All linters pass locally. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MsAYv5RhNLE54fPrviVgS
This commit is contained in:
@@ -2,7 +2,50 @@ name: CI
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
# Lint gate: runs on the plain Docker-backend runner (not the Gentoo
|
||||
# container) and must pass before the build job starts. Mirrors the lint job
|
||||
# in the homeserver repo; `just lint` runs markdownlint/shellcheck/yamllint/
|
||||
# actionlint over the repo.
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# SHA-256 Gitea repo: actions/checkout's internal `git init` must also
|
||||
# create a SHA-256 repo or the fetch-by-OID fails ("mismatched
|
||||
# algorithms"). GIT_DEFAULT_HASH makes init match. (The build job below
|
||||
# avoids checkout for the same SHA-256 reason but predates this
|
||||
# workaround; its curl+tar still works, so it is left as-is.)
|
||||
- uses: actions/checkout@v4
|
||||
env:
|
||||
GIT_DEFAULT_HASH: sha256
|
||||
|
||||
# setup-just fetches its binary from GitHub; on a Gitea runner the default
|
||||
# github-token is the *Gitea* token (GitHub rejects it 401), so pass none
|
||||
# and use GitHub's unauthenticated API.
|
||||
- uses: extractions/setup-just@v4
|
||||
with:
|
||||
github-token: ""
|
||||
|
||||
- uses: taiki-e/install-action@v2
|
||||
env:
|
||||
GITHUB_TOKEN: ""
|
||||
with:
|
||||
tool: shellcheck
|
||||
|
||||
- name: Install markdownlint-cli
|
||||
run: npm install -g markdownlint-cli
|
||||
|
||||
# actionlint has no maintained setup-action and uv ships via astral.sh;
|
||||
# both installers hit their own release assets (no GitHub token needed).
|
||||
- name: Install yamllint + actionlint tooling
|
||||
run: |
|
||||
curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR=/usr/local/bin sh
|
||||
bash <(curl -fsSL https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) latest /usr/local/bin
|
||||
|
||||
- name: Run linters
|
||||
run: just lint
|
||||
|
||||
build:
|
||||
needs: lint
|
||||
# The label only schedules the job on the (Docker-backend) runner; the steps
|
||||
# actually run inside the Gentoo container declared below.
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
Reference in New Issue
Block a user