Skip to content

Lint-and-Format CI Job + Pre-commit Config #3

Lint-and-Format CI Job + Pre-commit Config

Lint-and-Format CI Job + Pre-commit Config #3

Workflow file for this run

# SPDX-FileCopyrightText: 2026 Andrew Zhang <whisper67265@outlook.com>
#
# SPDX-License-Identifier: BSL-1.0
name: Lint and format
on:
push:
pull_request:
permissions:
contents: read
jobs:
lint-and-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae
with:
path: ~/.cache/prek
key: ${{ runner.os }}-${{ runner.arch }}-prek-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-prek-
- name: Setup Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: '3.14'
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b
with:
version: 0.11.12
- name: pre-commit
run: |
uv run --only-group pre-commit prek run --all-files --show-diff-on-failure
uv run --only-group pre-commit prek cache gc
env:
RUFF_OUTPUT_FORMAT: github
REUSE_OUTPUT_FORMAT: github
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: diff
run: git diff
if: always()
- uses: pre-commit-ci/lite-action@5d6cc0eb514c891a40562a58a8e71576c5c7fb43
if: always()
with:
msg: 'chore(pre-commit): apply code formatting'