forked from SimVascular/svZeroDSolver
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (78 loc) · 2.56 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
# This workflow builds and tests svZeroDSolver. It is built and tested on
# different versions of ubuntu and macOS.
name: Build and test
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-latest, macos-13, macos-latest]
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
- name: Install ubuntu dependencies
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt update && sudo apt install build-essential cmake lcov
- name: Install svZeroDSolver
run: |
#export PATH="/usr/share/miniconda/bin:$PATH"
#alias conda="$CONDA/bin/conda"
conda create -n zerod python=3.11.4
conda run -n zerod pip install -e ".[dev]"
- name: Test the build
run: |
cd tests
conda run -n zerod pytest -v --durations=0
- name: Build using CMake
run: |
mkdir Release
cd Release
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_DISTRIBUTION=ON ..
make -j2
- name: Test interface
run: |
cd tests/test_interface
mkdir build_tests
cd build_tests
cmake ../
make -j2
cd test_01
./svZeroD_interface_test01 ../../../../Release ../../test_01/svzerod_3Dcoupling.json
cd ../test_02
./svZeroD_interface_test02 ../../../../Release ../../test_02/svzerod_tuned.json
- name: Generate code coverage
if: startsWith(matrix.os, 'ubuntu-22.04')
run: |
cd Release
cmake -DENABLE_COVERAGE=ON ..
make -j2
cd ../tests
conda run -n zerod pytest -v --durations=0 --coverage
cd ../Release
make coverage
- name: Save coverage report
if: startsWith(matrix.os, 'ubuntu-22.04')
uses: actions/upload-artifact@v3
with:
name: coverage_report
path: Release/coverage
- name: Upload coverage reports to Codecov
if: startsWith(matrix.os, 'ubuntu-22.04')
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Build installer
run: |
cd Release
cpack
cp distribution/svZeroDSolver_* ..
- name: Upload installer
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }} installer
path: svZeroDSolver_*
if-no-files-found: error