-
-
Notifications
You must be signed in to change notification settings - Fork 1
206 lines (203 loc) · 6.11 KB
/
ci.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
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
name: CI
on:
- push
- pull_request
jobs:
nose:
runs-on: ubuntu-20.04
steps:
- name: set up Python 3.6
uses: actions/setup-python@v5
with:
python-version: 3.6
- name: pip install wheel
run: |
python3 -m pip install wheel
- name: build wheel
run: |
python3 -m pip wheel --no-binary ':all:' nose
- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: nose
path: nose-*.whl
compression-level: 0
retention-days: 1
main:
strategy:
matrix:
include:
- python: '2.7'
os: ubuntu-20.04
- python: '3.6'
os: ubuntu-20.04
- python: '3.7'
os: ubuntu-20.04
- python: '3.8'
os: ubuntu-20.04
- python: '3.9'
os: ubuntu-20.04
- python: '3.10'
os: ubuntu-22.04
- python: '3.11'
os: ubuntu-22.04
- python: '3.12'
os: ubuntu-22.04
- python: '3.13'
os: ubuntu-24.04
runs-on: ${{matrix.os}}
needs: nose
steps:
- uses: actions/checkout@v4
- name: set up PATH
run: |
PATH+=:~/.local/bin
echo "$PATH" >> $GITHUB_PATH
- name: set up Python ${{matrix.python}}
if: matrix.python != 2.7
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python}}
- name: set up APT
if: ${{ ! env.pythonLocation }}
run: |
printf 'Apt::Install-Recommends "false";\n' | sudo tee -a /etc/apt/apt.conf
sudo apt-get update
- name: set up Python 2.7 (with APT + get-pip)
if: ${{ ! env.pythonLocation }}
run: |
sudo apt-get install -y python-is-python2
wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
sudo python get-pip.py
rm get-pip.py
- name: set up distutils
if: env.pythonLocation
run: |
if ! [ -d ${{env.pythonLocation}}/lib/python*/distutils/ ]; then
python -m pip install setuptools
echo SETUPTOOLS_USE_DISTUTILS=local | tee -a $GITHUB_ENV;
fi
- name: set up pip
if: env.pythonLocation
run: |
sed -i -e 's/ sys.exit(.*)/ raise/' ${{env.pythonLocation}}/lib/python*/site-packages/pip/_internal/utils/setuptools_build.py
python -m pip list
- name: install deps
run: |
python -m pip install "futures; python_version < '3'"
python -m pip install docutils
- name: build
run:
python setup.py build
- name: check docs
run: |
dpkg-parsechangelog -ldoc/changelog --all 2>&1 >/dev/null | { ! grep .; }
private/check-rst
- name: download nose
if: env.pythonLocation
uses: actions/download-artifact@v4
with:
name: nose
- name: install nose
if: env.pythonLocation
run: |
python -m pip install nose-*.whl
# work-around for <https://github.com/nose-devs/nose/issues/1116>:
sed -i -e 's/ from unittest import _TextTestResult$/ from unittest import TextTestResult as _TextTestResult/' ${{env.pythonLocation}}/lib/python*/site-packages/nose/result.py
if ! python -c 'import imp'; then
python -m pip install zombie-imp
fi
- name: install nose
if: ${{ ! env.pythonLocation }}
run: |
python -m pip install nose
- name: run tests
run: |
python tests/run-tests -v
- name: check test coverage
run: |
private/update-coverage
git diff --exit-code
- name: install
run:
python setup.py install --user
- name: check whether the module is installed correctly
run: |
cd /
python -m pydiatra --version
- name: check whether the executable is installed correctly
run: |
cd /
pyXdiatra=py${pyver%.*}diatra
$pyXdiatra --version
env:
pyver: ${{matrix.python}}
- name: APT install man-db
if: ${{ ! env.pythonLocation }}
run: |
sudo apt-get install -y man-db
- name: check whether the manual pages are installed correctly
run: |
export MATHPATH=~/.local/share/man
cd /
man 1 pydiatra | grep -A 15 -w PYDIATRA
pyXdiatra=py${pyver%.*}diatra
man 1 $pyXdiatra | grep -A 15 -w PYDIATRA
env:
pyver: ${{matrix.python}}
continue-on-error:
${{ (env.SETUPTOOLS_USE_DISTUTILS && true) || false }}
# FIXME: "No manual entry for pydiatra in section 1"
- name: install with pip
run: |
rm -rvf ~/.local/lib/python*/site-packages/pydiatra*
python -m pip install .
- name: run pydiatra
run: |
PYTHON=python private/run-pydiatra
- name: run pyflakes
run: |
python -m pip install pyflakes
PYTHON=python private/run-pyflakes
- name: run pylint
run: |
python -m pip install pylint
PYTHON=python private/run-pylint
windows:
strategy:
matrix:
include:
- python: '3.4'
os: windows-2019
- python: '3.9'
os: windows-2019
- python: '3.11'
os: windows-2019
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: set up Python ${{matrix.python}}
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python}}
- name: install deps
run: |
python -m pip install "futures; python_version < '3'"
python -m pip install docutils
- name: build
run:
python setup.py build
- name: remove CRs from test files
run: |
sed -i -e 's/\r$//' tests/*.t
- name: run tests
run: |
# work-around for <https://github.com/nose-devs/nose/issues/1115>:
python -m pip install --upgrade 'setuptools<58'
python -m pip install --upgrade 'wheel<0.38'
# work-around for <https://github.com/nose-devs/nose/issues/1099>:
no_build_isolation=$(python -m pip install --help | grep -oF ' --no-build-isolation ' || true)
python -m pip install $no_build_isolation --no-binary ':all:' nose
python tests/run-tests -v
shell: bash
# vim:ts=2 sts=2 sw=2 et