Skip to content

Commit 6f71900

Browse files
committed
ci: add GitHub Actions CI workflow
Add comprehensive CI workflow with: - Style checking (black, flake8) - Type checking (mypy) - Spell checking (codespell) - Unit tests on Python 3.9-3.13 (x86_64 and arm64) - Wheel building - Documentation building with mkdocs - GitHub Pages deployment on tags Signed-off-by: Ben Copeland <ben.copeland@linaro.org>
1 parent 512ef51 commit 6f71900

File tree

1 file changed

+140
-0
lines changed

1 file changed

+140
-0
lines changed

.github/workflows/ci.yml

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
tags: ['v*']
7+
pull_request:
8+
branches: [main, master]
9+
10+
jobs:
11+
stylecheck:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-python@v5
16+
with:
17+
python-version: '3.12'
18+
- name: Install dependencies
19+
run: pip install black flake8 tuxpkg
20+
- name: Run stylecheck
21+
run: make stylecheck
22+
23+
typecheck:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: actions/setup-python@v5
28+
with:
29+
python-version: '3.12'
30+
- name: Install dependencies
31+
run: |
32+
pip install -e .
33+
pip install -r requirements-dev.txt
34+
- name: Run typecheck
35+
run: make typecheck
36+
37+
spellcheck:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v4
41+
- uses: actions/setup-python@v5
42+
with:
43+
python-version: '3.12'
44+
- name: Install dependencies
45+
run: pip install codespell tuxpkg
46+
- name: Run spellcheck
47+
run: make spellcheck
48+
49+
unit-tests:
50+
runs-on: ubuntu-latest
51+
strategy:
52+
fail-fast: false
53+
matrix:
54+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
55+
steps:
56+
- uses: actions/checkout@v4
57+
- uses: actions/setup-python@v5
58+
with:
59+
python-version: ${{ matrix.python-version }}
60+
- name: Install dependencies
61+
run: |
62+
pip install -e .
63+
pip install -r requirements-dev.txt
64+
- name: Run tests
65+
run: make test
66+
67+
unit-tests-arm64:
68+
runs-on: ubuntu-24.04-arm
69+
strategy:
70+
fail-fast: false
71+
matrix:
72+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
73+
steps:
74+
- uses: actions/checkout@v4
75+
- uses: actions/setup-python@v5
76+
with:
77+
python-version: ${{ matrix.python-version }}
78+
- name: Install dependencies
79+
run: |
80+
pip install -e .
81+
pip install -r requirements-dev.txt
82+
- name: Run tests
83+
run: make test
84+
85+
build-wheel:
86+
runs-on: ubuntu-latest
87+
steps:
88+
- uses: actions/checkout@v4
89+
- uses: actions/setup-python@v5
90+
with:
91+
python-version: '3.12'
92+
- name: Install flit
93+
run: pip install flit
94+
- name: Build wheel
95+
run: flit build
96+
- uses: actions/upload-artifact@v4
97+
with:
98+
name: wheel
99+
path: dist/*.whl
100+
101+
docs:
102+
runs-on: ubuntu-latest
103+
steps:
104+
- uses: actions/checkout@v4
105+
- uses: actions/setup-python@v5
106+
with:
107+
python-version: '3.12'
108+
- name: Install dependencies
109+
run: pip install mkdocs-material tuxpkg
110+
- name: Build docs
111+
run: make doc
112+
- uses: actions/upload-artifact@v4
113+
with:
114+
name: docs
115+
path: public
116+
117+
pages:
118+
runs-on: ubuntu-latest
119+
needs: docs
120+
if: startsWith(github.ref, 'refs/tags/v')
121+
permissions:
122+
pages: write
123+
id-token: write
124+
environment:
125+
name: github-pages
126+
url: ${{ steps.deployment.outputs.page_url }}
127+
steps:
128+
- uses: actions/download-artifact@v4
129+
with:
130+
name: docs
131+
path: public
132+
- name: Setup Pages
133+
uses: actions/configure-pages@v4
134+
- name: Upload artifact
135+
uses: actions/upload-pages-artifact@v3
136+
with:
137+
path: public
138+
- name: Deploy to GitHub Pages
139+
id: deployment
140+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)