From bc4872d95c5f2648f385e9a837a4998ca253cbf7 Mon Sep 17 00:00:00 2001 From: Danny Willems Date: Mon, 16 Mar 2026 16:58:20 +0100 Subject: [PATCH 1/2] CI: add per-commit workflow triggered by ci:per-commit label When a PR with the ci:per-commit label is merged, every commit pushed to main runs the full CI matrix. This makes it easy to identify which commit broke the build and revert it. Closes #59 --- .github/workflows/ci-per-commit.yaml | 64 ++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/ci-per-commit.yaml diff --git a/.github/workflows/ci-per-commit.yaml b/.github/workflows/ci-per-commit.yaml new file mode 100644 index 0000000..43fc540 --- /dev/null +++ b/.github/workflows/ci-per-commit.yaml @@ -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 From f595bae78862c344e7e3fafa73675d18332695a0 Mon Sep 17 00:00:00 2001 From: Danny Willems Date: Mon, 16 Mar 2026 17:00:09 +0100 Subject: [PATCH 2/2] CHANGELOG: add per-commit CI workflow entry --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57bc309..3934b17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 @@ -163,6 +165,7 @@ and this project adheres to +[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 @@ -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