Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/ci-per-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: CI per commit (labeled PRs)

on:
push:
branches:
- main

jobs:
check-label:
name: Check for ci:per-commit label
runs-on: ubuntu-latest
outputs:
has_label: ${{ steps.check.outputs.has_label }}
steps:
- name: Find associated PR and check label
id: check
env:
GH_TOKEN: ${{ github.token }}
run: |
PRS=$(gh api \
"repos/${{ github.repository }}/commits/${{ github.sha }}/pulls" \
--jq '.[].number')
HAS_LABEL="false"
for pr in $PRS; do
LABELS=$(gh api \
"repos/${{ github.repository }}/pulls/${pr}" \
--jq '.labels[].name')
if echo "$LABELS" | grep -q "^ci:per-commit$"; then
HAS_LABEL="true"
break
fi
done
echo "has_label=${HAS_LABEL}" >> "$GITHUB_OUTPUT"

ci:
name: CI
needs: check-label
if: needs.check-label.outputs.has_label == 'true'
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync
- name: lint
run: uv run ruff check .
- name: format check
run: uv run black --check .
- name: sort-check
run: uv run isort --check-only .
- name: typecheck
run: uv run mypy l9format
- name: test
run: uv run pytest
- name: security-audit
run: uv run pip-audit
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ and this project adheres to
- Migrate from Poetry to uv: update `pyproject.toml` to PEP 621 format with
`hatchling` build backend, replace `poetry run` with `uv run` in Makefile,
and switch CI to `astral-sh/setup-uv` ([5f4fc51], [#56])
- CI: add per-commit workflow triggered by `ci:per-commit` label for easier
bisect and revert ([bc4872d], [#59])

## [1.4.0] - 2026-02-09

Expand Down Expand Up @@ -163,6 +165,7 @@ and this project adheres to

<!-- Commit links -->

[bc4872d]: https://github.com/LeakIX/l9format-python/commit/bc4872d
[6c9eecd]: https://github.com/LeakIX/l9format-python/commit/6c9eecd
[5f4fc51]: https://github.com/LeakIX/l9format-python/commit/5f4fc51
[ac8a1db]: https://github.com/LeakIX/l9format-python/commit/ac8a1db
Expand Down Expand Up @@ -254,4 +257,5 @@ and this project adheres to
[#50]: https://github.com/LeakIX/l9format-python/pull/50
[#51]: https://github.com/LeakIX/l9format-python/pull/51
[#56]: https://github.com/LeakIX/l9format-python/pull/56
[#59]: https://github.com/LeakIX/l9format-python/issues/59
[#43]: https://github.com/LeakIX/l9format-python/issues/43
Loading