Static tests¶
Runs a minimal static analysis bundle on every push to give fast feedback without external services.
pre-commit/actionruns hooks defined in.pre-commit-config.yamlzbeekman/EditorConfig-Actionenforces.editorconfigrules
Usage¶
.github/workflows/build-static-tests.yaml
on:
push:
jobs:
static:
uses: nolte/gh-plumbing/.github/workflows/reusable-pre-commit.yaml@<tag>
Required status check
Combine the workflow with a branch-protection rule that requires the static / Static CI Tests check—see Settings.
Central configuration¶
.github/workflows/reusable-pre-commit.yaml
name: Reusable — Pre-Commit
on:
workflow_call:
# Explicit permissions per spec/project/github-actions-best-practices §B:
# workflow level is the minimum, write scopes are granted per job.
permissions:
contents: read # checkout + pre-commit; the hooks never push
jobs:
static:
name: "Static CI Tests"
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: '3.x'
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1