-
Notifications
You must be signed in to change notification settings - Fork 3
98 lines (83 loc) · 2.8 KB
/
build.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Build CI
on:
pull_request:
types: [opened, reopened]
push:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Checkout Current Repo
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Install dependencies
# cmake ships with the ubuntu-latest runner
run: |
sudo apt-get install python3-dev
python3 -m pip install -r docs/requirements.txt -r requirements.txt -r requirements-dev.txt
- name: Run cpp-linter as a py pkg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
id: linter
run: |
sudo apt-get install clang-format-14
cpp-linter \
--version=14 \
--style=file \
--tidy-checks='-*' \
--lines-changed-only=true \
--ignore='src/linux/gpio.h' \
--format-review=true \
--file-annotations=false \
--step-summary=true
- name: C++ Linter checks failed?
if: steps.linter.outputs.checks-failed > 0
run: exit 1
- name: Build package for docs extraction and linting examples
run: |
python -m pip install build
python -m build
python -m pip install dist/pyrf24-*.whl
- name: check python typing
run: mypy src
- name: lint python sources
run: ruff check examples/*.py src/pyrf24/*.py* setup.py docs/conf.py
- name: format python sources
run: ruff format examples/*.py src/pyrf24/*.py* setup.py docs/conf.py
- name: Get doc dependencies
run: |-
sudo apt-get update
sudo apt-get install -y libgl-dev libglvnd-dev libxkbcommon-x11-0 graphviz
- name: Build docs
working-directory: docs
env:
# required for pySide6 on headless linux (as used by sphinx-social-cards extension)
QT_QPA_PLATFORM: offscreen
run: sphinx-build -E -W -b html . _build/html
- name: Save built docs as artifact
uses: actions/upload-artifact@v4
with:
name: "pyRF24_docs"
path: ${{ github.workspace }}/docs/_build/html
- name: upload to github pages
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html
- name: Save distributable wheels as artifacts
uses: actions/upload-artifact@v4
with:
name: "pyRF24_pkg_dist"
path: ${{ github.workspace }}/dist
- name: Validate distribution
run: |
python3 -m pip install twine
python3 -m twine check dist/*