Skip to content
name: C++/Python Tests
on:
push:
merge_group:
workflow_dispatch:
pull_request:
branches:
- master
jobs:
build:
name: C++ tests Ubuntu
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [ "3.9" ]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v3
- run: git fetch --prune --unshallow
- run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV
- name: Set up AMICI C++ libraries
uses: ./.github/actions/setup-amici-cpp
- name: C++ tests
run: scripts/run-cpp-tests.sh
- name: Codecov CPP
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.info
flags: cpp
fail_ci_if_error: true
- name: Run sonar-scanner
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')"
osx:
name: Tests OSX
runs-on: macos-latest
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- uses: actions/checkout@v3
- run: git fetch --prune --unshallow
- run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV
- run: echo "BNGPATH=${AMICI_DIR}/ThirdParty/BioNetGen-2.7.0" >> $GITHUB_ENV
# Ensure CMake is using the python version that we will use for the python tests later on
- run: echo "PYTHON_EXECUTABLE=${Python3_ROOT_DIR}/bin/python3" >> $GITHUB_ENV
# install amici dependencies
- name: homebrew
run: |
brew install hdf5 swig gcc cppcheck libomp boost \
&& brew ls -v boost \
&& brew ls -v libomp \
&& echo LDFLAGS="-L/usr/local/lib/ -L/usr/local/Cellar/boost/1.81.0_1/lib/" >> $GITHUB_ENV \
&& echo CPPFLAGS="-I /usr/local/Cellar/boost/1.81.0_1/include/" >> $GITHUB_ENV
- name: Build AMICI
run: scripts/buildAll.sh
- name: Install python package
run: scripts/installAmiciSource.sh
- name: cppcheck
run: scripts/run-cppcheck.sh
- name: Python tests
run: scripts/run-python-tests.sh
- name: C++ tests
run: scripts/run-cpp-tests.sh