-
Notifications
You must be signed in to change notification settings - Fork 89
148 lines (125 loc) · 4.65 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
name: Test
on:
push:
pull_request:
schedule:
- cron: '42 4 5,20 * *'
jobs:
Test:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, '3.10', 3.11, 3.12, 3]
MPI: ['openmpi', 'no'] # 'mpich' is broken, https://github.com/pmodels/mpich/issues/7256
defaults:
run:
# this is needed, because otherwise conda env is not available
shell: bash -leo pipefail {0} {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 "${{ matrix.MPI }}" | xargs -rt sudo update-alternatives --set mpi
update-alternatives --list mpirun|grep "${{ matrix.MPI }}" | 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 "${{ matrix.MPI }}" | xargs -rt sudo update-alternatives --set mpi
update-alternatives --list mpirun|grep "${{ matrix.MPI }}" | xargs -rt sudo update-alternatives --set mpirun
- uses: actions/checkout@v2
- uses: mamba-org/setup-micromamba@v1
with:
environment-name: test
cache-environment: false
cache-downloads: true
- name: Install python dependencies
run: |
micromamba install -c conda-forge --file conda-requirements.txt python=${{ matrix.python-version }} corner coveralls pytest toml
pip install git+https://github.com/JohannesBuchner/coverage-lcov@feature-coverage7
#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: install mpi4py
if: ${{ matrix.MPI != 'no' }}
run: |
pip install --user mpi4py
python -c 'import 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
echo RDMAV_FORK_SAFE=1 >> $GITHUB_ENV
- name: Install PyMultiNest
run: |
python -m pip install .
- 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 -m pytest
coverage report
coverage-lcov
python pymultinest_demo_minimal.py
python pymultinest_demo.py
- name: MPI tests
if: ${{ matrix.MPI == 'openmpi' }}
run: |
mpiexec -np 4 --oversubscribe python pymultinest_demo_minimal.py
mpiexec -np 4 --oversubscribe python pymultinest_demo.py
- name: MPI tests
if: ${{ matrix.MPI == 'mpich' }}
run: |
mpiexec -np 4 python pymultinest_demo_minimal.py
mpiexec -np 4 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:
runs-on: ubuntu-latest
timeout-minutes: 20
defaults:
run:
# this is needed, because otherwise conda env is not available
shell: bash -leo pipefail {0} {0}
steps:
- uses: actions/checkout@v2
- uses: mamba-org/setup-micromamba@v1
with:
cache-environment: false
cache-downloads: true
environment-name: test
environment-file: conda-requirements.txt
- name: Install dependencies
run: micromamba install -c conda-forge --quiet multinest
- name: Test imports
run: |
python -m pip install .
python -c 'import pymultinest'
- name: Tests
run: |
python pymultinest_demo_minimal.py