Repository navigation
111 lines (92 loc) · 2.96 KB
/
Copy pathbuild.yml
File metadata and controls
111 lines (92 loc) · 2.96 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Build CI
on:
pull_request:
branches: [master]
push:
branches: [master]
permissions: {}
jobs:
linters:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-python@v7
id: python-setup
with:
python-version: "3.x"
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
with:
python-version: ${{ steps.python-setup.outputs.python-version }}
- name: Cache pre-commit environments
uses: actions/cache@v6.1.0
with:
path: '~/.cache/pre-commit'
key: pre-commit-${{ steps.python-setup.outputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit hooks
run: uv run pre-commit run --all-files --show-diff-on-failure
test-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-python@v7
id: python-setup
with:
python-version: "3.x"
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
with:
python-version: ${{ steps.python-setup.outputs.python-version }}
- name: Install testing tools
run: uv sync --group tests
- name: Collect coverage
env:
UV_NO_SYNC: 1
run: |
uv run coverage run -m pytest
uv run coverage report
uv run coverage xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./coverage.xml
verbose: true # optional (default = false)
build-docs:
runs-on: ubuntu-latest
env:
QT_QPA_PLATFORM: offscreen
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-python@v7
id: python-setup
with:
python-version: "3.14"
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
with:
python-version: ${{ steps.python-setup.outputs.python-version }}
- name: Install deps
run: |-
uv sync --group docs
sudo apt-get update
packages=(libgl1-mesa-dev libxkbcommon-x11-0 graphviz)
if apt-cache show libgvplugin-neato-layout8 > /dev/null 2>&1; then
packages+=(libgvplugin-neato-layout8)
fi
sudo apt install -y "${packages[@]}"
dot -V
- name: Build docs
working-directory: docs
env:
UV_NO_SYNC: 1
run: uv run sphinx-build -E -W -b html . _build/html
- name: Archive docs
uses: actions/upload-artifact@v7
with:
name: docs
path: ${{ github.workspace }}/docs/_build/html