-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (57 loc) · 1.79 KB
/
unit-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
name: PYOPATRA Unit Tests
on:
push:
paths-ignore:
- 'docs/**'
- 'examples/**'
- 'README.rst'
- 'LICENSE.txt'
- 'tests/hpc_tests/**'
jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: |
sudo apt-get update && sudo apt-get install \
libmpich12 \
libmpich-dev \
mpich \
libhdf5-dev \
cmake lcov \
libeigen3-dev \
pybind11-dev \
python3 \
libpython3-dev \
python3-pip \
wget
test -n $CC && unset CC
test -n $CXX && unset CXX
wget https://github.com/catchorg/Catch2/archive/v2.13.4.tar.gz
tar -xzf v2.13.4.tar.gz
cd Catch2-2.13.4
cmake -Bbuild -H. -DBUILD_TESTING=OFF
sudo cmake --build build/ --target install
cd ..
pip3 install numpy scipy matplotlib coverage pytest netcdf4 mpi4py h5py
- name: Install PYOPATRA C++
run: |
mkdir cpp_build && cd cpp_build
cmake .. -DBUILD_TEST=ON -DCODE_COVERAGE=ON
make
cd ..
- name: Install PYOPATRA Python
run: |
pip3 install .
- name: Run tests
run: |
./cpp_build/pyopatra_test
coverage run -m pytest test/python_tests
- name: Send code coverage
run: |
lcov --capture --directory cpp_build --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info
lcov --list coverage.info
bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"
bash <(curl -s https://codecov.io/bash) -cF python