88 branches : [ main ]
99 workflow_dispatch :
1010
11+ permissions :
12+ contents : read
13+
1114concurrency :
1215 group : ${{ github.workflow }}-${{ github.ref }}
13- cancel-in-progress : true
16+ cancel-in-progress : ${{ github.event_name == 'pull_request' }}
1417
1518jobs :
16- tests :
19+ lint :
20+ runs-on : ubuntu-latest
21+ steps :
22+ - name : Checkout
23+ uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
24+ with :
25+ persist-credentials : false
26+
27+ - name : Set up Python
28+ uses : actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
29+ with :
30+ python-version : " 3.15"
31+
32+ - name : Install dependencies
33+ run : |
34+ python3 -m pip install --upgrade pip
35+ python3 -m pip install . --group lint
36+
37+ - name : Ruff lint
38+ run : python3 -m ruff check --output-format=github .
39+
40+ - name : Ruff format
41+ run : python3 -m ruff format --check --diff .
42+
43+ - name : Mypy
44+ run : python3 -m mypy
1745
46+ tests :
1847 runs-on : ubuntu-latest
1948 strategy :
49+ fail-fast : false
2050 matrix :
21- python-version : ["3.8 ", "3.9 ", "3.10 ", "3.11 ", "3.12", "3.13 "]
51+ python-version : ["3.11 ", "3.12 ", "3.13 ", "3.14 ", "3.15 "]
2252
2353 steps :
2454 - name : Checkout
25- uses : actions/checkout@v6
55+ uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
56+ with :
57+ persist-credentials : false
2658
2759 - name : Set up Python ${{ matrix.python-version }}
28- uses : actions/setup-python@v6
60+ uses : actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
2961 with :
3062 python-version : ${{ matrix.python-version }}
3163
32- - uses : actions/cache@v5
33- with :
34- path : ~/.cache/pip
35- key : ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('pyproject.toml') }}
36-
3764 - name : Install dependencies
3865 run : |
3966 python3 -m pip install --upgrade pip
40- python3 -m pip install "." pytest
67+ python3 -m pip install . --group test
4168
4269 - name : Test with pytest
4370 run : |
@@ -46,16 +73,18 @@ jobs:
4673 publish :
4774 runs-on : ubuntu-latest
4875 if : ${{ startsWith(github.ref, 'refs/tags/') }}
49- needs : tests
76+ needs : [lint, tests]
5077 permissions :
5178 id-token : write # OIDC for uploading to PyPI
5279
5380 steps :
5481 - name : Checkout
55- uses : actions/checkout@v6
82+ uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
83+ with :
84+ persist-credentials : false
5685
5786 - name : Set up Python
58- uses : actions/setup-python@v6
87+ uses : actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
5988 with :
6089 python-version : " 3.11"
6190
6594 python3 -m build
6695
6796 - name : Publish package distributions to PyPI
68- uses : pypa/gh-action-pypi-publish@release/v1
97+ uses : pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
0 commit comments