-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (82 loc) · 2.44 KB
/
on-push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: on-push
on: [push]
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.12
- name: Install dependencies
run: |
pip install .[docs]
- name: Build Sphinx documentation
run: sphinx-build -n -W --keep-going doc doc/_build
static_checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.12
- name: Install dependencies
run: |
pip install .[test]
- name: Lint with Pylint
run: pylint --score=n not_my_board tests
- name: Check format with Black
run: black --check --quiet not_my_board tests doc
- name: Check import statement order with isort
run: isort --check not_my_board tests
- name: Check spelling
run: git ls-files -z | xargs -0 -- codespell
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Create test VM image
run: sudo ./scripts/vmctl makeimg
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install qemu-system
pip install .[test]
- name: Allow kvm usage
run: |
sudo chmod o+rw /dev/kvm || :
- name: Run tests
run: pytest -s
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.12
- name: Install dependencies
run: |
# python3-build is broken on 22.04:
# https://bugs.launchpad.net/ubuntu/+source/python-build/+bug/1992108
# install everything from pip instead
pip install build twine
- name: Build dist packages
run: |
export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
python3 -m build
- name: Upload to PyPi
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
if: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') && env.TWINE_PASSWORD != '' }}
run: twine upload --non-interactive dist/*