-
Notifications
You must be signed in to change notification settings - Fork 7
104 lines (89 loc) · 3.03 KB
/
python-app.yml
File metadata and controls
104 lines (89 loc) · 3.03 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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: topiary
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
concurrency:
group: topiary-ci-group
cancel-in-progress: false
jobs:
build-nix:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 1
matrix:
os: [ubuntu-latest,macos-latest]
python-version: ['3.11', '3.12', '3.13']
steps:
- name: checkout
uses: actions/checkout@v4
- name: set up miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: topiary
environment-file: environment.yml
channel-priority: strict
python-version: ${{ matrix.python-version }}
auto-activate-base: false
miniconda-version: "latest"
- name: get dependency hashes
id: get-hashes
shell: bash
run: |
GENERAX_HASH=$(git ls-remote https://github.com/harmslab/generax.git HEAD | awk '{print $1}')
RAXML_HASH=$(git ls-remote https://github.com/harmslab/raxml-ng.git HEAD | awk '{print $1}')
echo "generax_hash=$GENERAX_HASH" >> $GITHUB_OUTPUT
echo "raxml_hash=$RAXML_HASH" >> $GITHUB_OUTPUT
- name: cache generax
id: cache-generax
uses: actions/cache@v4
with:
path: bin-cache/generax
key: ${{ runner.os }}-generax-${{ steps.get-hashes.outputs.generax_hash }}
- name: cache raxml-ng
id: cache-raxml
uses: actions/cache@v4
with:
path: bin-cache/raxml-ng
key: ${{ runner.os }}-raxml-${{ steps.get-hashes.outputs.raxml_hash }}
- name: install topiary
shell: bash -l {0}
run: |
# platform specific packages
conda install -c conda-forge cmake
python -m pip install .[dev] -vv
python -m pip install coverage flake8 pytest genbadge[tests] pytest-mock
# Ensure bin-cache exists
mkdir -p bin-cache
# compile generax if not cached
if [ ! -f bin-cache/generax ]; then
cd dependencies
conda run -n topiary bash compile-generax.sh
cp $CONDA_PREFIX/bin/generax ../bin-cache/
cd ..
else
cp bin-cache/generax $CONDA_PREFIX/bin/
fi
# compile raxml if not cached
if [ ! -f bin-cache/raxml-ng ]; then
cd dependencies
conda run -n topiary bash compile-raxml-ng.sh
cp $CONDA_PREFIX/bin/raxml-ng ../bin-cache/
cd ..
else
cp bin-cache/raxml-ng $CONDA_PREFIX/bin/
fi
- name: run flake8
shell: bash -l {0}
run: |
flake8 src/topiary tests --count --select=E9,F63,F7,F82 --show-source --statistics
- name: run pytest
shell: bash -l {0}
env:
TOPIARY_MPI_OVERSUBSCRIBE: "1"
run: |
pytest tests/ --run-raxml --run-generax --run-blast