-
Notifications
You must be signed in to change notification settings - Fork 89
155 lines (130 loc) · 4.61 KB
/
test.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
name: Test
on:
push:
pull_request:
schedule:
- cron: '42 4 5,20 * *'
jobs:
Test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
#python-version: [3.8, 3.9, '3.10', 3]
#MPI: ['mpich', 'openmpi', 'no']
python-version: ['3.10']
MPI: ['openmpi', 'no']
defaults:
run:
# this is needed, because otherwise conda env is not available
shell: bash -l {0}
steps:
- name: Install build dependencies
run: |
sudo apt-get update && sudo apt-get -y --no-install-recommends install -y -qq libblas{3,-dev} liblapack{3,-dev} libatlas-base-dev cmake build-essential git gfortran
- name: Install openmpi
if: ${{ matrix.MPI == 'openmpi' }}
run: |
sudo apt-get install -qq openmpi-bin libopenmpi-dev python3-mpi4py
update-alternatives --list mpi|grep "$WITHMPI" | xargs -rt sudo update-alternatives --set mpi
update-alternatives --list mpirun|grep "$WITHMPI" | xargs -rt sudo update-alternatives --set mpirun
- name: Install mpich
if: ${{ matrix.MPI == 'mpich' }}
run: |
sudo apt-get install -qq mpich libmpich-dev python3-mpi4py
update-alternatives --list mpi|grep "$WITHMPI" | xargs -rt sudo update-alternatives --set mpi
update-alternatives --list mpirun|grep "$WITHMPI" | xargs -rt sudo update-alternatives --set mpirun
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge
python-version: ${{ matrix.python-version }}
mamba-version: "*"
- name: Install python dependencies
run: |
mamba install --quiet --file conda-requirements.txt corner coveralls coverage-lcov
sed --in-place -e 's,"report_include",,g' -e 's,"report_omit",,g' /usr/share/miniconda/envs/*/lib/python*/site-packages/coverage_lcov/converter.py
conda list
conda info -a
- name: No-MPI case
if: ${{ matrix.MPI != 'no' }}
run: |
pip install --user mpi4py
- name: Install MultiNest
run: |
git clone https://github.com/JohannesBuchner/MultiNest
mkdir -p MultiNest/build; pushd MultiNest/build; cmake .. && make && popd
test -e MultiNest/lib/libmultinest.so
echo LD_LIBRARY_PATH=MultiNest/lib/:${LD_LIBRARY_PATH} >> $GITHUB_ENV
- name: Install PyMultiNest
run: |
python setup.py install --user
- name: Test imports
run: |
python -c 'import pymultinest'
rm -rf chains/
- name: No-MPI tests
if: ${{ matrix.MPI == 'no' }}
run: |
# do not test pycuba, it is broken
rm tests/pycuba_test.py
coverage run setup.py test
coverage report
coverage-lcov
python pymultinest_demo_minimal.py
python pymultinest_demo.py
- name: MPI tests
if: ${{ matrix.MPI != 'no' }}
run: |
python -c 'import mpi4py' &&
mpiexec -np 4 --oversubscribe python pymultinest_demo_minimal.py;
python -c 'import mpi4py' &&
mpiexec -np 4 --oversubscribe python pymultinest_demo.py;
- name: Long filename test
run: |
python tests/pymultinest_long_name_test.py;
- name: Marginal scripts test
run: |
python multinest_marginals.py chains/3-
python multinest_marginals_corner.py chains/3-
- name: Coveralls Finished
uses: coverallsapp/github-action@master
if: ${{ matrix.MPI == 'no' }}
with:
path-to-lcov: lcov.info
github-token: ${{ secrets.github_token }}
flag-name: MPI-${{ matrix.MPI }}
CondaTest:
if: false
runs-on: ubuntu-latest
defaults:
run:
# this is needed, because otherwise conda env is not available
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: false
channels: conda-forge
python-version: ${{ matrix.python-version }}
environment-file: conda-requirements.txt
mamba-version: "*"
- name: Install dependencies
run: |
mamba install --quiet multinest
- name: Test imports
run: |
python -m pip install .
python -c 'import pymultinest'
- name: Tests
run: |
python pymultinest_demo_minimal.py