-
Notifications
You must be signed in to change notification settings - Fork 2
112 lines (92 loc) · 2.6 KB
/
tests.yml
File metadata and controls
112 lines (92 loc) · 2.6 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
105
106
107
108
109
110
111
112
# This workflow runs test
name: tests
on:
pull_request:
branches:
- "main"
- "develop"
jobs:
test-minimal:
runs-on: ubuntu-latest
strategy:
matrix:
py-version:
- 3.x
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Set up Python ${{ matrix.py-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.py-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
- name: Install via pip
run: |
pip install -e .
- name: Run serial tests
run: |
pytest
tests:
runs-on: ubuntu-latest
strategy:
matrix:
py-version:
- 3.7
- 3.8
- 3.x
mpi:
- openmpi
os:
- ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Set up Python ${{ matrix.py-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.py-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install lyncs_setuptools
- name: Install OpenMPI Parallel HDF5
run: bash .bash/install-hdf5.sh
# Skipping for now because not working TODO
- name: Install h5py
if: false
run: |
CC=mpicc HDF5_MPI="ON" HDF5_DIR="${LIO_HDF5_PATH}" pip install --no-binary=h5py h5py
- name: Install via pip
run: |
pip install -e .[all]
- name: Run serial tests
run: |
coverage run --rcfile=setup.cfg -m pytest test/serial
- name: Run MPI tests (procs=2, 4, 7)
run: |
PROCS=(2 4 7)
for proc in "${PROCS[@]}"
do
echo "::group::Run MPI tests (procs=$proc)"
mpirun -n $proc --oversubscribe coverage run --rcfile=setup.cfg -m pytest test/MPI --with-mpi
echo "::endgroup::"
done
- name: Run Dask tests
if: false
run: |
coverage run --rcfile=setup.cfg -m pytest test/Dask
- name: Coverage report
run: |
coverage combine
coverage report
- name: Upload Coverage report
if: ${{ matrix.py-version == '3.x' }}
run: |
coverage xml
export CODECOV_TOKEN="${{ secrets.CODECOV_TOKEN }}"
bash <(curl -s https://codecov.io/bash) -f ./coverage.xml -n $(lyncs_setuptools name)