-
Notifications
You must be signed in to change notification settings - Fork 4
136 lines (118 loc) · 4.73 KB
/
parpe_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
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
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
# https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables
name: parPE tests
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '48 4 * * *'
jobs:
container:
runs-on: ubuntu-latest
container: ghcr.io/icb-dcm/custom_ci_image:master
name: parPE tests
env:
# mpiexec prefix for running tests
# If we are running in docker, we generally don't have SYS_PTRACE
# permissions and thus, cannot use vader. Also disable Infiniband.
PARPE_TESTS_MPIEXEC: mpiexec -n 5 --oversubscribe --allow-run-as-root --mca btl_vader_single_copy_mechanism none --mca btl ^openib --mca oob_tcp_if_include lo --mca btl_tcp_if_include lo --mca orte_base_help_aggregate 0
steps:
- uses: actions/checkout@master
- name: chown checkout directory
# https://github.com/actions/runner/issues/2033
run: chown -R $(id -u):$(id -g) $PWD
- run: git fetch --prune --unshallow
- run: echo "PARPE_BASE=$(pwd)" >> $GITHUB_ENV
- run: echo "PARPE_BUILD=${PARPE_BASE}/build" >> $GITHUB_ENV
- run: echo "AMICI_PATH=${PARPE_BASE}/deps/AMICI/" >> $GITHUB_ENV
# sonar cloud
- run: echo "SONAR_SCANNER_VERSION=5.0.1.3006" >> $GITHUB_ENV
- run: echo "SONAR_SCANNER_HOME=/root/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux" >> $GITHUB_ENV
- run: echo "SONAR_SCANNER_OPTS=-server" >> $GITHUB_ENV
- run: echo "${SONAR_SCANNER_HOME}/bin" >> $GITHUB_PATH
- run: echo "/root/.sonar/build-wrapper-linux-x86" >> $GITHUB_PATH
- name: Info
run: lsb_release -a && printenv
# Build dependencies
- name: Install AMICI deps
run: |
cd $AMICI_PATH \
&& scripts/buildSuiteSparse.sh \
&& scripts/buildSundials.sh
- name: Install AMICI
run: |
cmake \
-S ${AMICI_PATH} \
-B ${AMICI_PATH}/build \
-DCMAKE_BUILD_TYPE=Debug \
-DENABLE_PYTHON=ON \
-DBUILD_TESTS=OFF \
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH};${AMICI_PATH}/ThirdParty/SuiteSparse/install" \
&& cmake --build "${AMICI_PATH}/build" --parallel -- VERBOSE=1
- name: Install parPE deps
run: |
sudo apt install lcov
- name: "Install parPE deps: fides"
run: |
sudo apt install libspdlog-dev && ${PARPE_BASE}/ThirdParty/installFides.sh
- name: Configure parPE
run: |
cmake \
-S"${PARPE_BASE}" \
-B"${PARPE_BUILD}" \
-DCMAKE_CXX_FLAGS="-Wall -Wextra -Werror -Wno-deprecated-copy" \
-DIPOPT_INCLUDE_DIRS=/usr/include/coin/ \
-DIPOPT_LIBRARIES=/usr/lib/libipopt.so \
-DGCOV_REPORT=TRUE \
-DBUILD_TESTING=TRUE \
-DPARPE_ENABLE_FIDES=TRUE \
-DPARPE_ENABLE_CERES=FALSE
- name: Build parPE
# with sonar build wrapper
run: |
build-wrapper-linux-x86-64 --out-dir bw-output \
cmake --build "${PARPE_BUILD}" --parallel -- VERBOSE=1
- name: Run parPE python unittests
run: |
$PARPE_BASE/misc/run_in_venv.sh $PARPE_BASE/build/venv \
pip install pytest-cov \
&& $PARPE_BASE/misc/run_in_venv.sh $PARPE_BASE/build/venv \
pytest \
--cov-report=xml:$PARPE_BUILD/coverage_py.xml \
--cov=parpe --cov-append \
$PARPE_BASE/python/tests/
# Redundant with parpe_coverage_cobertura
#- name: Run CTEST
# run: cd ${PARPE_BUILD} && CTEST_OUTPUT_ON_FAILURE=1 make test
- name: Create coverage report
run: |
cd ${PARPE_BUILD} \
&& CTEST_OUTPUT_ON_FAILURE=1 make parpe_coverage \
&& make ExperimentalCoverage
- name: Cache sonar files
id: cache-sonar
uses: actions/cache@v4
with:
path: sonar_cache
key: ${{ runner.os }}-sonar_cache
- name: Run sonar-scanner
if: ${{ env.SONAR_TOKEN != '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner \
-Dsonar.cfamily.build-wrapper-output=bw-output \
-Dsonar.projectVersion="$(git describe --abbrev=4 --dirty=-dirty --always --tags | tr -d '\n')"
- name: Run example notebooks
run: |
misc/run_notebook.sh \
examples/parpeamici/steadystate/parpeExampleSteadystateBasic.ipynb \
examples/parpeamici/steadystate/parpeExampleSteadystateHierarchical.ipynb
- name: Run valgrind
run: |
cd ${PARPE_BUILD} \
&& if (CTEST_OUTPUT_ON_FAILURE=1 make ExperimentalMemCheck); \
then cat Testing/Temporary/MemoryChecker.*.log; \
else cat Testing/Temporary/MemoryChecker.*.log; exit 1; fi