-
Notifications
You must be signed in to change notification settings - Fork 2
413 lines (395 loc) · 14.7 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
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
name: ci
on:
push:
branches:
- master
tags:
- '*'
pull_request:
branches:
- '*'
schedule:
- cron: '0 0 * * 1' # weekly
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
subdivision:
- "test_auxiliary_lib"
- "test_dataframe"
- "test_frozen_instrumentation"
- "test_genome_instrumentation"
- "test_juxtaposition"
- "test_phylogenetic_inference/test_estimators"
- "test_phylogenetic_inference/test_pairwise"
- "test_phylogenetic_inference/test_population"
- "test_phylogenetic_inference/test_priors"
- "test_phylogenetic_inference/test_tree"
- "test_serialization"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_depth_proportional_resolution_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_depth_proportional_resolution_tapered_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_fixed_resolution_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_geom_seq_nth_root_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_geom_seq_nth_root_tapered_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_nominal_resolution_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_perfect_resolution_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_pseudostochastic_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_recency_proportional_resolution_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_recency_proportional_resolution_curbed_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_stochastic_algo"
- "test_stratum_retention_strategy/test_stratum_retention_policy_evaluators"
- "test_stratum_retention_viz"
- "test_test_drive"
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo sed -i 's/azure\.//' /etc/apt/sources.list
sudo apt-get update -o Acquire::Retries=3
sudo apt-get install -y ffmpeg -o Acquire::Retries=3
python -m pip install --upgrade pip setuptools
pip install tox tox-gh-actions
- name: Test with tox
run: |
export HSTRAT_TESTS_SUBDIVISION=${{ matrix.subdivision }}
tox
cli:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install Python dependencies
uses: py-actions/py-dependency-install@v4
with:
path: "requirements-dev/requirements-testing.txt"
- name: Run examples
run: |
python3 -m hstrat
python3 -m hstrat.dataframe.surface_unpack_reconstruct --help
examples:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install Python dependencies
uses: py-actions/py-dependency-install@v4
with:
path: "requirements-dev/requirements-jit.txt"
- name: Install Python dependencies
uses: py-actions/py-dependency-install@v4
with:
path: "requirements-dev/requirements-testing.txt"
- name: Run examples
run: ./examples/run_all.sh
build-script:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v1
- run: |
sudo sed -i 's/azure\.//' /etc/apt/sources.list
sudo apt-get update -o Acquire::Retries=3
sudo apt-get install -y python3-pybind11 -o Acquire::Retries=3
- run: ./build.sh
coverage:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
subdivision:
- "test_auxiliary_lib"
- "test_dataframe"
- "test_frozen_instrumentation"
- "test_genome_instrumentation"
- "test_juxtaposition"
- "test_phylogenetic_inference/test_estimators"
- "test_phylogenetic_inference/test_pairwise"
- "test_phylogenetic_inference/test_population"
- "test_phylogenetic_inference/test_priors"
- "test_phylogenetic_inference/test_tree"
- "test_serialization"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_depth_proportional_resolution_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_depth_proportional_resolution_tapered_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_fixed_resolution_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_geom_seq_nth_root_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_geom_seq_nth_root_tapered_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_nominal_resolution_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_perfect_resolution_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_pseudostochastic_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_recency_proportional_resolution_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_recency_proportional_resolution_curbed_algo"
- "test_stratum_retention_strategy/test_stratum_retention_algorithms/test_stochastic_algo"
- "test_stratum_retention_strategy/test_stratum_retention_policy_evaluators"
- "test_stratum_retention_viz"
- "test_test_drive"
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |
sudo sed -i 's/azure\.//' /etc/apt/sources.list
sudo apt-get update -o Acquire::Retries=3
sudo apt-get install -y ffmpeg -o Acquire::Retries=3
python -m pip install --upgrade pip setuptools
python -m pip install -r requirements-dev/py310/requirements-testing.txt
- name: Log coverage configuration
run: coverage debug sys
- name: Run tests with coverage report
run: coverage run -m pytest tests/test_hstrat/${{ matrix.subdivision }}
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }} # required
flags: tests # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
tidy:
runs-on: ubuntu-24.04
steps:
- name: Install apt dependencies
run: sudo apt-get install -y rename
- uses: actions/checkout@v1
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -r requirements-dev/py310/requirements-testing.txt
- name: Test isort tidyness
uses: jamescurtin/isort-action@master
with:
requirementsFiles: "requirements-dev/py310/requirements-testing.txt"
- name: Test Black tidyness
uses: psf/black@27d20144a7517594e24a1649451177b2a11284be
with:
version: "22.10.0"
- uses: editorconfig-checker/action-editorconfig-checker@main
- name: Test editorconfig tidyness
run: editorconfig-checker
- name: Test tidy/ tidyness
run: ./tidy/test_tidy.sh
paper:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v2
- 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
# regression test for https://github.com/mmore500/hstrat/commit/c276530
packaging-bdist:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build bdist
run: |
python3 -m venv env
source env/bin/activate
python3 -m pip install -r requirements-dev/requirements-release.txt
python3 setup.py bdist_wheel
tree dist
deactivate
- 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 {} \;
find . -type f -name '*.pyi' -exec rm {} \;
python3 -c "import hstrat; print(hstrat.__version__)"
# regression test for https://github.com/mmore500/hstrat/commit/c276530
packaging-sdist:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build sdist
run: |
python3 -m venv env
source env/bin/activate
python3 -m pip install -r requirements-dev/requirements-release.txt
python3 setup.py sdist
tree dist
deactivate
- name: Upgrade pip
run: python3 -m pip install pip --upgrade
- name: Install from sdist
run: python3 -m pip install dist/*.tar.gz
- name: Test install
run: |
find . -type f -name '*.py' -exec rm {} \;
find . -type f -name '*.pyi' -exec rm {} \;
python3 -c "import hstrat; print(hstrat.__version__)"
# regression test for https://github.com/mmore500/hstrat/commit/c276530
packaging-source:
runs-on: ubuntu-24.04
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: |
rm -rf *
cd
python3 -c "import hstrat; print(hstrat.__version__)"
deploy-ghcr:
name: Docker Image Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set Tags
id: set_tags
run: |
if [[ "${GITHUB_REF_NAME}" != *merge ]]; then
echo "TAGS=latest,${GITHUB_REF_NAME}" >> $GITHUB_ENV
else
echo "TAGS=latest" >> $GITHUB_ENV
fi
- name: Build and Push to GitHub Container Registry
uses: docker/build-push-action@v1
with:
push: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') }}
tags: ${{ env.TAGS }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
repository: mmore500/hstrat
registry: ghcr.io
add_git_labels: true
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, windows-latest, macos-14]
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Set up Ubuntu Dependecies
if: matrix.os == 'ubuntu-24.04'
run: |
sudo sed -i 's/azure\.//' /etc/apt/sources.list
sudo apt-get update -o Acquire::Retries=3
sudo apt-get install -y python3.12-dev python3-dev python3-pybind11 -o Acquire::Retries=3
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_TEST_COMMAND: python3 -m hstrat.dataframe.surface_unpack_reconstruct --help
CIBW_TEST_SKIP: "*313-* pp* *win* *i686* *musllinux*"
CIBW_SKIP: "*-win32"
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
deploy-test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev/py310/requirements-release.txt
- name: Build package
run: python setup.py egg_info --tag-build="${{github.run_number}}" sdist bdist_wheel
- name: Test publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
- name: Install from test PyPI
run: |
rm -rf *
python3 -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ hstrat
- name: Test install
run: |
python3 -c "import hstrat; print(hstrat.__version__)"
deploy:
if: startsWith(github.ref, 'refs/tags/v')
needs:
- build_sdist
- build_wheels
- build-script
- coverage
- cli
- deploy-test
- examples
- packaging-bdist
- packaging-sdist
- packaging-source
- test
- tidy
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -r requirements-dev/py310/requirements-release.txt
- uses: actions/download-artifact@v4
with:
# unpacks default artifact into dist/
# if `name: artifact` is omitted, the action will create extra parent dir
pattern: cibw-*
path: dist
merge-multiple: true
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}