Skip to content

parPE tests

parPE tests #1069

Workflow file for this run

# 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 \
&& cmake --build "${AMICI_PATH}/build" --parallel -- VERBOSE=1
- name: Install parPE Python deps
run: |
pip install -r ${PARPE_BASE}/python/requirements.txt \
&& 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
- 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@v3
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