File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : CI per commit (labeled PRs)
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+
8+ jobs :
9+ check-label :
10+ name : Check for ci:per-commit label
11+ runs-on : ubuntu-latest
12+ outputs :
13+ has_label : ${{ steps.check.outputs.has_label }}
14+ steps :
15+ - name : Find associated PR and check label
16+ id : check
17+ env :
18+ GH_TOKEN : ${{ github.token }}
19+ run : |
20+ PRS=$(gh api \
21+ "repos/${{ github.repository }}/commits/${{ github.sha }}/pulls" \
22+ --jq '.[].number')
23+ HAS_LABEL="false"
24+ for pr in $PRS; do
25+ LABELS=$(gh api \
26+ "repos/${{ github.repository }}/pulls/${pr}" \
27+ --jq '.labels[].name')
28+ if echo "$LABELS" | grep -q "^ci:per-commit$"; then
29+ HAS_LABEL="true"
30+ break
31+ fi
32+ done
33+ echo "has_label=${HAS_LABEL}" >> "$GITHUB_OUTPUT"
34+
35+ ci :
36+ name : CI
37+ needs : check-label
38+ if : needs.check-label.outputs.has_label == 'true'
39+ strategy :
40+ fail-fast : false
41+ matrix :
42+ python-version : ["3.11", "3.12", "3.13"]
43+ os : ["ubuntu-latest", "macos-latest", "windows-latest"]
44+ runs-on : ${{ matrix.os }}
45+ steps :
46+ - uses : actions/checkout@v6
47+ - name : Install uv
48+ uses : astral-sh/setup-uv@v6
49+ with :
50+ python-version : ${{ matrix.python-version }}
51+ - name : Install dependencies
52+ run : uv sync
53+ - name : lint
54+ run : uv run ruff check .
55+ - name : format check
56+ run : uv run black --check .
57+ - name : sort-check
58+ run : uv run isort --check-only .
59+ - name : typecheck
60+ run : uv run mypy l9format
61+ - name : test
62+ run : uv run pytest
63+ - name : security-audit
64+ run : uv run pip-audit
Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ and this project adheres to
1717- Migrate from Poetry to uv: update ` pyproject.toml ` to PEP 621 format with
1818 ` hatchling ` build backend, replace ` poetry run ` with ` uv run ` in Makefile,
1919 and switch CI to ` astral-sh/setup-uv ` ([ 5f4fc51] , [ #56 ] )
20+ - CI: add per-commit workflow triggered by ` ci:per-commit ` label for easier
21+ bisect and revert ([ bc4872d] , [ #59 ] )
2022
2123## [ 1.4.0] - 2026-02-09
2224
@@ -163,6 +165,7 @@ and this project adheres to
163165
164166<!-- Commit links -->
165167
168+ [ bc4872d ] : https://github.com/LeakIX/l9format-python/commit/bc4872d
166169[ 6c9eecd ] : https://github.com/LeakIX/l9format-python/commit/6c9eecd
167170[ 5f4fc51 ] : https://github.com/LeakIX/l9format-python/commit/5f4fc51
168171[ ac8a1db ] : https://github.com/LeakIX/l9format-python/commit/ac8a1db
@@ -254,4 +257,5 @@ and this project adheres to
254257[ #50 ] : https://github.com/LeakIX/l9format-python/pull/50
255258[ #51 ] : https://github.com/LeakIX/l9format-python/pull/51
256259[ #56 ] : https://github.com/LeakIX/l9format-python/pull/56
260+ [ #59 ] : https://github.com/LeakIX/l9format-python/issues/59
257261[ #43 ] : https://github.com/LeakIX/l9format-python/issues/43
You can’t perform that action at this time.
0 commit comments