-
Notifications
You must be signed in to change notification settings - Fork 213
182 lines (182 loc) · 7.01 KB
/
build.yaml
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
name: Build
on:
- push
- pull_request
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: linux-3.12
python-version: "3.12"
os: ubuntu-latest
- name: windows-3.12
python-version: "3.12"
os: windows-latest
- name: macos-3.12-skip-exe
python-version: "3.12"
os: macos-latest
- name: linux-3.12-lint-update-help-skip-exe
python-version: "3.12"
os: ubuntu-latest
- name: linux-3.11-pytype-skip-exe
python-version: "3.11"
os: ubuntu-latest
- name: linux-3.10-skip-exe
python-version: "3.10"
os: ubuntu-latest
- name: linux-3.9-skip-exe
python-version: "3.9"
os: ubuntu-latest
- name: linux-3.8-skip-exe
python-version: "3.8"
os: ubuntu-latest
- name: linux-pypy-3.10-skip-exe
python-version: pypy-3.10
os: ubuntu-latest
- name: linux-pypy-3.9-skip-exe
python-version: pypy-3.9
os: ubuntu-latest
- name: linux-pypy-3.8-skip-exe
python-version: pypy-3.8
os: ubuntu-latest
steps:
- name: Checkout source repo
uses: actions/checkout@v4
- name: Apt install system dependencies (linux unless -skip-exe)
if: ${{ startsWith(matrix.name, 'linux-') && !contains(matrix.name, '-skip-exe') }}
run: |
echo "::group::Run sudo apt-get update"
sudo apt-get update
echo "::endgroup::"
echo "::group::Run sudo apt-get install graphviz"
sudo apt-get install graphviz
echo "::endgroup::"
echo "::group::Run dot -V"
DOT_VERSION="$(dot -V 2>&1)"
echo $DOT_VERSION;
echo "::endgroup::"
echo "::notice::Apt installed ${DOT_VERSION#dot - }"
shell: bash
- name: Brew install system dependencies (macos unless -skip-exe)
if: ${{ startsWith(matrix.name, 'macos-') && !contains(matrix.name, '-skip-exe') }}
run: |
echo "::group::Run brew update --preinstall"
brew update --preinstall
echo "::endgroup::"
echo "::group::Run brew install graphviz"
brew install graphviz
echo "::endgroup::"
echo "::group::Run dot -V"
DOT_VERSION="$(dot -V 2>&1)"
echo $DOT_VERSION
echo "::endgroup::"
echo "::notice::Brew installed ${DOT_VERSION#dot - }"
shell: bash
- name: Choco install system dependencies (windows unless -skip-exe)
if: ${{ startsWith(matrix.name, 'windows-') && !contains(matrix.name, '-skip-exe') }}
run: |
echo "::group::Run choco install --no-progress graphviz"
choco install --no-progress graphviz
echo "::endgroup::"
echo "::group::Run dot -V"
DOT_VERSION="$(dot -V 2>&1)"
echo $DOT_VERSION
echo "::endgroup::"
echo "::notice::Choco installed ${DOT_VERSION#dot - }"
shell: bash
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Pip install dependencies
run: |
echo "::group::Run python -m pip install --upgrade pip setuptools wheel"
python -m pip install --upgrade pip setuptools wheel
echo "::endgroup::"
echo "::group::Run pip install .[test] flake8"
pip install .[test] flake8
echo "::endgroup::"
- name: Run full tests (unless -skip-exe)
if: ${{ !contains(matrix.name, '-skip-exe') }}
run: python run-tests.py
- name: Run tests with --only-exe (unless -skip-exe)
if: ${{ !contains(matrix.name, '-skip-exe') }}
run: python run-tests.py --only-exe --cov-append
- name: Run tests with --skip-exe (always included)
run: python run-tests.py --skip-exe --cov-append
- name: Upload test coverage
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Check test coverage
run: |
echo "::group::Run coverage report --fail-under=100 --show-missing --skip-covered"
FAILED=0
coverage report --fail-under=100 --show-missing --skip-covered || FAILED=$?
echo "::endgroup::"
[ $FAILED -eq 0 ] || echo "::warning::coverage report --fail-under=100 failed with exit code $FAILED"
shell: bash
- name: Run build-docs.py -b doctest (unless -skip-exe)
if: ${{ !contains(matrix.name, '-skip-exe') }}
run: |
echo "::group::Run pip install .[docs]"
pip install .[docs]
echo "::endgroup::"
echo "::group::Run build-docs.py -b doctest"
FAILED=0
python build-docs.py -b doctest || FAILED=$?
echo ::endgroup::
[ $FAILED -eq 0 ] || echo "::warning::build-docs.py -b doctest failed with exit code $FAILED"
shell: bash
- name: Run try-examples.py (unless -skip-exe)
if: ${{ !contains(matrix.name, '-skip-exe') }}
run: |
echo "::group::Run try-examples.py"
FAILED=0
python try-examples.py || FAILED=$?
echo "::endgroup::"
SEVERITY=warning
${{ startsWith(matrix.name, 'windows-') }} && SEVERITY=notice
[ $FAILED -eq 0 ] || echo "::$SEVERITY::try-examples.py failed with exit code $FAILED (XFAIL 'Graphviz not built with triangulation library' on Windows cbuild)"
shell: bash
- name: Run lint-code.py (if -lint)
if: ${{ contains(matrix.name, '-lint') }}
run: |
echo "::group::Run lint-code.py"
FAILED=0
python lint-code.py || FAILED=$?
echo "::endgroup::"
[ $FAILED -eq 0 ] || echo "::warning::lint-code.py failed with exit code $FAILED"
shell: bash
- name: Run update-help.py (if -update-help)
if: ${{ contains(matrix.name, '-update-help') }}
run: |
echo "::group::Run update-help.py"
FAILED=0
python update-help.py || FAILED=$?
echo "::endgroup::"
[ $FAILED -eq 0 ] || echo "::warning::update-help.py failed with exit code $FAILED"
- name: Run pytype (if -pytype)
if: ${{ contains(matrix.name, '-pytype') }}
run: |
echo "::group::Run pip install pytype"
pip install pytype
echo "::endgroup::"
echo "::group::Run pytype"
FAILED=0
pytype || FAILED=$?
echo "::endgroup::"
[ $FAILED -eq 0 ] || echo "::warning::pytype failed with exit code $FAILED"
shell: bash
- name: Upload ${{ matrix.name }} artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}
path: |
test-log.txt
doctest-output/
examples/*.gv
examples/*.pdf