-
Notifications
You must be signed in to change notification settings - Fork 61
320 lines (316 loc) · 10.6 KB
/
ci.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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
name: ci
on: [push, pull_request, workflow_dispatch]
jobs:
examples:
runs-on: ubuntu-20.04
strategy:
fail-fast: False
matrix:
python-version:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get install aptitude
sudo aptitude install -y gcc-7 g++-7 gfortran-7
sudo apt-get install libpython2.7 # required by paup
python -m pip install --upgrade pip
- name: Install paup
run: |
temp_dir=$(mktemp -d)
wget -P ${temp_dir} http://phylosolutions.com/paup-test/paup4a169_ubuntu64.gz
gunzip ${temp_dir}/paup4a169_ubuntu64.gz
chmod +x ${temp_dir}/paup4a169_ubuntu64
sudo mv ${temp_dir}/paup4a169_ubuntu64 /usr/local/bin/paup
echo "export DENDROPY_PAUP_EXECUTABLE_PATH=/usr/local/bin/paup" >> "${GITHUB_ENV}"
- name: Install dendropy
run: |
python -m pip install .
- name: Run examples
run: |
cd docs/source/examples
# only allow known failures
# and enforce removal of working examples from known failures
for f in *.py; do
echo "${f}"
if timeout 60 python "${f}" && ! grep -q "${f}" backlogged-fail-whitelist.txt; then
:
elif grep -q "${f}" backlogged-fail-whitelist.txt; then
:
else
echo FAIL "${f}"
exit 1
fi
done
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff==0.0.292
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with ruff
run: |
# stop the build if there are Python syntax errors or undefined names
./lint.sh
tests:
runs-on: ubuntu-20.04
strategy:
fail-fast: False
matrix:
python-version:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
continue-on-error: true
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get install aptitude
sudo aptitude install -y gcc-7 g++-7 gfortran-7
sudo apt-get install libpython2.7 # required by paup
python -m pip install --upgrade pip
if [ -f .github/workflows/requirements.txt ]; then pip install -r .github/workflows/requirements.txt; fi
- name: Install paup
run: |
temp_dir=$(mktemp -d)
wget -P ${temp_dir} http://phylosolutions.com/paup-test/paup4a169_ubuntu64.gz
gunzip ${temp_dir}/paup4a169_ubuntu64.gz
chmod +x ${temp_dir}/paup4a169_ubuntu64
sudo mv ${temp_dir}/paup4a169_ubuntu64 /usr/local/bin/paup
echo "export DENDROPY_PAUP_EXECUTABLE_PATH=/usr/local/bin/paup" >> "${GITHUB_ENV}"
- name: Unit tests with setup.py
run: |
python setup.py pytest --addopts '-m "not smoke"'
- name: Smoke tests with setup.py
run: |
python setup.py pytest --addopts "-m smoke"
entrypoints:
runs-on: ubuntu-20.04
strategy:
fail-fast: False
matrix:
python-version:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
continue-on-error: true
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get install aptitude
sudo aptitude install -y gcc-7 g++-7 gfortran-7
sudo apt-get install libpython2.7 # required by paup
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install .
- name: Test sumtrees
run: |
which sumtrees
sumtrees --help
sumtrees 2>&1 | grep sumtrees || exit 1
- name: Test sumlabels
run: |
which sumlabels
sumlabels --help
sumlabels 2>&1 | grep sumlabels || exit 1
- name: Test dendropy-format
run: |
which dendropy-format
dendropy-format --help
dendropy-format 2>&1 | grep dendropy-format || exit 1
- name: Test deprecated entrypoints
run: |
which sumtrees.py
sumtrees.py --help
sumtrees.py 2>&1 | grep sumtrees.py || exit 1
which sumlabels.py
sumlabels.py --help
sumlabels.py 2>&1 | grep sumlabels.py || exit 1
coverage:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- name: Setup Python
uses: actions/setup-python@master
with:
python-version: 3.8
- name: Install dependencies
run: |
sudo apt-get install aptitude
sudo aptitude install -y gcc-7 g++-7 gfortran-7
sudo apt-get install libpython2.7 # required by paup
python -m pip install --upgrade pip
temp_dir=$(mktemp -d)
wget -P ${temp_dir} http://phylosolutions.com/paup-test/paup4a169_ubuntu64.gz
gunzip ${temp_dir}/paup4a169_ubuntu64.gz
chmod +x ${temp_dir}/paup4a169_ubuntu64
sudo mv ${temp_dir}/paup4a169_ubuntu64 /usr/local/bin/paup
echo "export DENDROPY_PAUP_EXECUTABLE_PATH=/usr/local/bin/paup" >> "${GITHUB_ENV}"
- name: Install coverage dependencies
run: |
python3 -m pip install pytest
python3 -m pip install pytest-cov
- name: Generate coverage report
run: |
python3 -m pytest tests/unittests --cov=tests --cov-report=xml
- uses: codecov/codecov-action@v4
with:
token: ae13d715-bae4-4e6d-9dce-f47e7d7c7c01
flags: unittests # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
packaging-bdist:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install build tools
run: python3 -m pip install pip setuptools wheel --upgrade
- name: Build bdist
run: |
python3 setup.py bdist_wheel
tree dist
- name: Upgrade pip
run: python3 -m pip install pip --upgrade
- name: Install from bdist
run: python3 -m pip install dist/*.whl
- name: Test install
run: |
find . -type f -name '*.py' -exec rm {} \;
python3 -c "import dendropy; print(dendropy.__version__)"
packaging-sdist:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install build tools
run: python3 -m pip install pip setuptools wheel --upgrade
- name: Build sdist
run: |
python3 setup.py sdist
tree dist
- name: Install from sdist
run: python3 -m pip install dist/*.tar.gz
- name: Test install
run: |
find . -type f -name '*.py' -exec rm {} \;
python3 -c "import dendropy; print(dendropy.__version__)"
packaging-source:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Upgrade pip
run: python3 -m pip install pip --upgrade
- name: Install from source
run: python3 -m pip install .
- name: Test install
run: |
find . -type f -name '*.py' -exec rm {} \;
python3 -c "import dendropy; print(dendropy.__version__)"
docs:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v4
continue-on-error: true
with:
python-version: 3.9
- name: Upgrade pip
run: python3 -m pip install pip --upgrade
- name: Install from source
run: python3 -m pip install .
- name: Install documentation build dependencies
run: python3 -m pip install -r docs/requirements.txt
- name: Build documentation
run: make -C docs html
- name: Deploy docs
if: github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs/build/html # The folder the action should deploy.
# uses: jsmrcaga/[email protected]
# with:
# NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
# NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
# NETLIFY_DEPLOY_MESSAGE: "Prod deploy v${{ github.ref }}"
# NETLIFY_DEPLOY_TO_PROD: true
# install_command: "echo Skipping installing the dependencies"
# build_command: "echo Skipping building the web files"
# build_directory: docs/build/html
deploy:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs:
- examples
- lint
- tests
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- run: python setup.py sdist bdist_wheel
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
paper:
runs-on: ubuntu-latest
name: Paper Draft
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build draft PDF
uses: openjournals/openjournals-draft-action@master
with:
journal: joss
# This should be the path to the paper within your repo.
paper-path: joss/paper.md
- name: Upload
uses: actions/upload-artifact@v4
with:
name: paper
# This is the output path where Pandoc will write the compiled
# PDF. Note, this should be the same directory as the input
# paper.md
path: joss/paper.pdf