Add new ruff-format-docs
hook
#3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
pre-commit: | |
name: pre-commit | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
- name: Install pre-commit | |
run: uv sync --group lint | |
- name: Cache pre-commit | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pre-commit | |
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} | |
- name: Run pre-commit | |
run: | | |
echo '```console' > "$GITHUB_STEP_SUMMARY" | |
# Enable color output for pre-commit and remove it for the summary | |
# Use --hook-stage=manual to enable slower pre-commit hooks that are skipped by default | |
uv run pre-commit run --all-files --show-diff-on-failure --color=always --hook-stage=manual | \ | |
tee >(sed -E 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})*)?[mGK]//g' >> "$GITHUB_STEP_SUMMARY") >&1 | |
exit_code="${PIPESTATUS[0]}" | |
echo '```' >> "$GITHUB_STEP_SUMMARY" | |
exit "$exit_code" | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
- "3.12" | |
- "3.13" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: uv sync --group test | |
- name: Run tests | |
run: uv run pytest --cov=. |