-
Notifications
You must be signed in to change notification settings - Fork 14
129 lines (109 loc) · 4.29 KB
/
tests.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
# This is a basic workflow to help you get started with Actions
name: build
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
pull_request:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019, macos-latest]
python-version: ["3.8", "3.10", "3.11"]
include:
- os: windows-2019
triplet: x64-windows
env:
CONDA_ENV_NAME: gadma_env
steps:
- name: Cancel previous runs.
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout.
uses: actions/checkout@v2
- name: Set up Python 3.
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set up Conda environment.
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge,bioconda
activate-environment: ${{ env.CONDA_ENV_NAME }}
solver: classic
- name: Install dadi and scikit-allel using conda.
run: |
conda install dadi
conda install scikit-allel
- name: Install GADMA and its dependencies.
run: |
bash install
# pip3 install Cython==0.29.18 # otherwise ConfigsSpace cause error for macOS
# TypeError: Expected float, got numpy.float64 when using Float
pip3 install -r requirements/bayes_opt.txt
pip3 install -r requirements/bayes_opt_addit.txt
pip3 install .
- name: Install msprime and momi2 (MacOS).
run: |
brew install gsl homebrew/core/hdf5
conda install msprime
pip3 install numpy
brew install libomp llvm
export LDFLAGS="-L/usr/local/opt/llvm/lib"
export CPPFLAGS="-I/usr/local/opt/llvm/include"
python3 -m pip install wheel==0.38.4
CC=$(brew --prefix llvm)/bin/clang pip install momi
python3 -m pip install --upgrade wheel
if: matrix.os == 'macos-latest' && matrix.python-version == '3.8'
# For some reason the last version of wheel cause an error for momi and dadi installation
# The error is the following: ModuleNotFoundError: No module named 'numpy'
- name: Install momi2 (Linux)
run: |
python3 -m pip install wheel==0.38.4
# Install non-Python-package dependencies, e.g. with conda
conda install hdf5 gsl
# Install momi and Python dependencies with pip
pip install numpy
pip install momi
python3 -m pip install --upgrade wheel
if: matrix.os != 'macos-latest' && matrix.python-version == '3.8'
- name: Uninstall SMAC (Windows).
if: runner.os == 'Windows'
shell: bash -l {0}
run: |
pip3 uninstall -y smac
- name: Uninstall SMAC (MacOS py3.6)
if: runner.os == 'MacOS' && matrix.python-version == '3.6'
run: pip3 uninstall -y smac
- name: Check installations of packages.
run: |
python3 -c "import numpy"
python3 -c "import scipy"
python3 -c "import dadi"
python3 -c "import moments"
python3 -c "import gadma"
- name: Show versions of all installed packages.
run: python3 -m pip freeze
- name: Show available engines and optimizations in gadma.
run: |
python3 -c "import gadma;print(gadma.engines.engine._registered_engines.keys())"
python3 -c "import gadma;print(gadma.optimizers.global_optimizer._registered_global_optimizers.keys())"
- name: Install dependencies for tests.
run: |
pip3 install -r requirements/tests.txt
- name: Run tests and codecov.
run: |
pytest --timeout=600 --cov=gadma --cov-report=xml -v tests --disable-warnings
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
if: runner.os == 'Linux' && matrix.python-version == '3.6'