55 types : [ published ]
66 pull_request :
77 push :
8+ branches-ignore :
9+ - ' dependabot/**'
810
911env :
1012 PY_COLORS : " 1"
1113
14+ permissions :
15+ contents : read
16+
1217jobs :
1318 test :
1419 runs-on : ${{ matrix.os }}
15- continue-on-error : ${{ matrix.experimental }} # See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idcontinue-on-error
1620 strategy :
1721 matrix :
1822 os : [ubuntu-latest, macos-latest, windows-latest]
19- experimental : [false]
20- python-version : [
21- " 3.8" ,
22- " 3.9" ,
23- " 3.10" ,
24- " 3.11" ,
25- " 3.12" ,
26- " pypy-3.8" ,
27- " pypy-3.9" ,
23+ env : [
24+ " py310" ,
25+ " py311" ,
26+ " py312" ,
27+ " py313" ,
28+ " py314" ,
29+ # "py313t",
30+ # "py314t",
31+ " pypy310" ,
32+ " pypy311" ,
2833 ]
29- # Python 3.9 is on macos-13 but not macos-latest (macos-14-arm64)
30- # https://github.com/actions/setup-python/issues/696#issuecomment-1637587760
31- exclude :
32- - { python-version: "3.8", os: "macos-latest", experimental: false }
33- - { python-version: "3.9", os: "macos-latest", experimental: false }
34- include :
35- - { python-version: "3.8", os: "macos-13", experimental: false }
36- - { python-version: "3.9", os: "macos-13", experimental: false }
37- # uncomment when python 3.13.0 alpha is available
38- # include:
39- # # Only test on a single configuration while there are just pre-releases
40- # - os: ubuntu-latest
41- # experimental: true
42- # python-version: "3.13.0-alpha - 3.13.0"
4334 fail-fast : false
4435 steps :
45- - uses : actions/checkout@v4
46- - name : Set up Python ${{ matrix.python-version }}
47- uses : actions/setup-python@v5
36+ - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
4837 with :
49- python-version : ${{ matrix.python-version }}
50- - name : Install dependencies
51- run : |
52- python -m pip install --upgrade pip
53- pip install tox
38+ fetch-depth : 0
39+ persist-credentials : false
40+ - name : Install uv
41+ uses : astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # 7.1.2
42+ - name : Install tox
43+ run : uv tool install tox --with tox-uv
5444 - name : Setup SocketCAN
5545 if : ${{ matrix.os == 'ubuntu-latest' }}
5646 run : |
47+ sudo apt-get update
5748 sudo apt-get -y install linux-modules-extra-$(uname -r)
5849 sudo ./test/open_vcan.sh
5950 - name : Test with pytest via tox
6051 run : |
61- tox -e gh
52+ tox -e ${{ matrix.env }}
6253 env :
6354 # SocketCAN tests currently fail with PyPy because it does not support raw CAN sockets
64- # See: https://foss.heptapod.net /pypy/pypy/-/ issues/3809
65- TEST_SOCKETCAN : " ${{ matrix.os == 'ubuntu-latest' && ! startsWith(matrix.python-version , 'pypy' ) }}"
55+ # See: https://github.com /pypy/pypy/issues/3808
56+ TEST_SOCKETCAN : " ${{ matrix.os == 'ubuntu-latest' && ! startsWith(matrix.env , 'pypy' ) }}"
6657 - name : Coveralls Parallel
67- uses : coverallsapp/github-action@v2
58+ uses : coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # 2.3.6
6859 with :
6960 github-token : ${{ secrets.github_token }}
70- flag-name : Unittests-${{ matrix.os }}-${{ matrix.python-version }}
61+ flag-name : Unittests-${{ matrix.os }}-${{ matrix.env }}
7162 parallel : true
7263 path-to-lcov : ./coverage.lcov
7364
7465 coveralls :
7566 needs : test
7667 runs-on : ubuntu-latest
7768 steps :
69+ - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
70+ with :
71+ fetch-depth : 0
72+ persist-credentials : false
7873 - name : Coveralls Finished
79- uses : coverallsapp/github-action@v2
74+ uses : coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # 2.3.6
8075 with :
8176 github-token : ${{ secrets.github_token }}
8277 parallel-finished : true
8378
8479 static-code-analysis :
8580 runs-on : ubuntu-latest
8681 steps :
87- - uses : actions/checkout@v4
88- - name : Set up Python
89- uses : actions/setup-python@v5
90- with :
91- python-version : " 3.10"
92- - name : Install dependencies
93- run : |
94- python -m pip install --upgrade pip
95- pip install -e .[lint]
96- - name : mypy 3.8
97- run : |
98- mypy --python-version 3.8 .
99- - name : mypy 3.9
100- run : |
101- mypy --python-version 3.9 .
102- - name : mypy 3.10
103- run : |
104- mypy --python-version 3.10 .
105- - name : mypy 3.11
106- run : |
107- mypy --python-version 3.11 .
108- - name : mypy 3.12
109- run : |
110- mypy --python-version 3.12 .
111- - name : ruff
112- run : |
113- ruff check can
114- - name : pylint
115- run : |
116- pylint \
117- can/**.py \
118- can/io \
119- doc/conf.py \
120- examples/**.py \
121- can/interfaces/socketcan
122-
123- format :
124- runs-on : ubuntu-latest
125- steps :
126- - uses : actions/checkout@v4
127- - name : Set up Python
128- uses : actions/setup-python@v5
82+ - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
12983 with :
130- python-version : " 3.10"
131- - name : Install dependencies
132- run : |
133- python -m pip install --upgrade pip
134- pip install -e .[lint]
135- - name : Code Format Check with Black
136- run : |
137- black --check --verbose .
84+ fetch-depth : 0
85+ persist-credentials : false
86+ - name : Install uv
87+ uses : astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # 7.1.2
88+ - name : Install tox
89+ run : uv tool install tox --with tox-uv
90+ - name : Run linters
91+ run : |
92+ tox -e lint
93+ - name : Run type checker
94+ run : |
95+ tox -e type
13896
13997 docs :
14098 runs-on : ubuntu-latest
14199 steps :
142- - uses : actions/checkout@v4
143- - name : Set up Python
144- uses : actions/setup-python@v5
100+ - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
145101 with :
146- python-version : " 3.10 "
147- - name : Install dependencies
148- run : |
149- python -m pip install --upgrade pip
150- pip install -e .[canalystii,gs_usb,mf4]
151- pip install -r doc/doc-requirements.txt
102+ fetch-depth : 0
103+ persist-credentials : false
104+ - name : Install uv
105+ uses : astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # 7.1.2
106+ - name : Install tox
107+ run : uv tool install tox --with tox-uv
152108 - name : Build documentation
153109 run : |
154- python -m sphinx -Wan --keep-going doc build
155- - name : Run doctest
156- run : |
157- python -m sphinx -b doctest -W --keep-going doc build
110+ tox -e docs
158111
159112 build :
160113 name : Packaging
161114 runs-on : ubuntu-latest
162115 steps :
163- - uses : actions/checkout@v4
164- with :
165- fetch-depth : 0 # fetch tags for setuptools-scm
166- - name : Set up Python
167- uses : actions/setup-python@v5
116+ - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
168117 with :
169- python-version : " 3.10"
118+ fetch-depth : 0
119+ persist-credentials : false
120+ - name : Install uv
121+ uses : astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # 7.1.2
170122 - name : Build wheel and sdist
171- run : pipx run build
123+ run : uv build
172124 - name : Check build artifacts
173- run : pipx run twine check --strict dist/*
125+ run : uvx twine check --strict dist/*
174126 - name : Save artifacts
175- uses : actions/upload-artifact@v4
127+ uses : actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # 5.0.0
176128 with :
177129 name : release
178130 path : ./dist
@@ -188,10 +140,15 @@ jobs:
188140 # upload to PyPI only on release
189141 if : github.event.release && github.event.action == 'published'
190142 steps :
191- - uses : actions/download-artifact@v4
143+ - uses : actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # 6.0.0
192144 with :
193145 path : dist
194146 merge-multiple : true
195147
148+ - name : Generate artifact attestation
149+ uses : actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # 3.0.0
150+ with :
151+ subject-path : ' dist/*'
152+
196153 - name : Publish release distributions to PyPI
197- uses : pypa/gh-action-pypi-publish@release/v1
154+ uses : pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # 1.13.0
0 commit comments