.. #995
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Code Analysis | |
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#on | |
on: | |
push: | |
branches: | |
- '*' | |
tags-ignore: | |
- 'v*' # done in release | |
pull_request: | |
schedule: | |
- cron: '0 2 * * SAT' | |
# About image content: | |
# https://github.com/actions/virtual-environments/blob/ubuntu18/20201210.0/images | |
# Global GHA doc: | |
# https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions | |
# To define local environment variable inside build steps | |
# https://github.community/t/support-saving-environment-variables-between-steps/16230 | |
# Support for YAML anchors: | |
# https://github.community/t/support-for-yaml-anchors/16128 | |
# Default working directory is equivalent to | |
# working-directory: ${{github.workspace}} | |
# always set shell (could be powershell in windows environment) | |
# shell: bash | |
env: | |
DEBUG_CI: true | |
jobs: | |
guideline-checks: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: false # submodules not required here | |
fetch-depth: 2 # git rev-parse HEAD^ will fail without this | |
- name: Inject slug/short variables | |
uses: rlespinasse/github-slug-action@v3.x | |
- name: before_script | |
shell: bash | |
run: .travis-ci/common/before_script.sh | |
- name: check | |
shell: bash | |
run: .travis-ci/checks/test.sh | |
build: | |
name: ${{ matrix.name }} | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: "Coverage mode" | |
os: ubuntu-22.04 | |
mode: Debug | |
enable_python: on | |
enable_octave: on | |
enable_coverage: on | |
force_update: on | |
# /!\ need after_success | |
- name: "Memcheck mode" | |
os: ubuntu-20.04 | |
mode: Debug | |
enable_python: on | |
enable_matlab: on | |
enable_memcheck: on | |
force_update: on | |
- name: "Address Sanitizer" | |
os: ubuntu-20.04 | |
mode: Debug | |
enable_python: off | |
enable_octave: off | |
enable_memcheck: off | |
force_update: on | |
sanitizer: address | |
- name: "Leak Sanitizer" | |
os: ubuntu-20.04 | |
mode: Debug | |
enable_python: off | |
enable_octave: off | |
enable_memcheck: off | |
force_update: on | |
sanitizer: leak | |
- name: "Thread Sanitizer" | |
os: ubuntu-20.04 | |
mode: Debug | |
enable_python: off | |
enable_octave: off | |
enable_memcheck: off | |
force_update: on | |
sanitizer: thread | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: 'release' | |
if: matrix.enable_R == 'on' | |
- name: Define local variables | |
shell: bash | |
run: | | |
echo "MODE=${{matrix.mode}}" >> $GITHUB_ENV | |
echo "ENABLE_PYTHON_BINDING=${{matrix.enable_python}}" >> $GITHUB_ENV | |
echo "ENABLE_OCTAVE_BINDING=${{matrix.enable_octave}}" >> $GITHUB_ENV | |
echo "ENABLE_R_BINDING=${{matrix.enable_R}}" >> $GITHUB_ENV | |
echo "ENABLE_COVERAGE=${{matrix.enable_coverage}}" >> $GITHUB_ENV | |
echo "ENABLE_MEMCHECK=${{matrix.enable_memcheck}}" >> $GITHUB_ENV | |
echo "SANITIZE=${{matrix.sanitizer}}" >> $GITHUB_ENV | |
- name: Define local variables Unix Like | |
shell: bash | |
run: | | |
if [ "${ENABLE_R_BINDING}" == "on" ]; then | |
echo "BUILD_NAME=r-linux-macos" >> $GITHUB_ENV | |
else | |
echo "BUILD_NAME=linux-macos" >> $GITHUB_ENV | |
fi | |
if: runner.os != 'Windows' | |
- name: Define local variables Windows | |
shell: bash | |
run: | | |
if [ "${ENABLE_OCTAVE_BINDING}" == "on" ]; then | |
echo "BUILD_NAME=octave-windows" >> $GITHUB_ENV | |
elif [ "${ENABLE_R_BINDING}" == "on" ]; then | |
echo "BUILD_NAME=r-windows" >> $GITHUB_ENV | |
else | |
echo "BUILD_NAME=windows" >> $GITHUB_ENV | |
fi | |
if: runner.os == 'Windows' | |
- name: pre-install-linux | |
shell: bash | |
run: | | |
if [ "${{matrix.force_update}}" == "on" ]; then | |
sudo apt update | |
fi | |
sudo apt install liblapack-dev python3-pip | |
if [ "${ENABLE_OCTAVE_BINDING}" == "on" ]; then | |
sudo apt install -qy octave liboctave-dev | |
fi | |
if [ "${ENABLE_MATLAB_BINDING}" == "on" ]; then | |
sudo apt install -qy intel-mkl | |
fi | |
if [ "${ENABLE_R_BINDING}" == "on" ]; then | |
sudo apt install -qy liblapack-dev gfortran # r-base | |
fi | |
if [ "${ENABLE_COVERAGE}" == "on" ]; then | |
sudo apt install -qy lcov | |
fi | |
if [ "${ENABLE_MEMCHECK}" == "on" ]; then | |
sudo apt install -qy valgrind python3-setuptools | |
fi | |
if: runner.os == 'Linux' # or use $RUNNER_OS | |
- name: install | |
shell: bash | |
run: .travis-ci/${BUILD_NAME}/install.sh | |
- name: Setup cmake | |
uses: jwlawson/actions-setup-cmake@v1.13 | |
with: | |
cmake-version: '3.24.x' | |
- name: before_script | |
shell: bash | |
run: .travis-ci/common/before_script.sh | |
- name: script | |
shell: bash | |
run: .travis-ci/${BUILD_NAME}/build.sh | |
- name: test | |
shell: bash | |
run: .travis-ci/${BUILD_NAME}/test.sh | |
- name: display Coverage report | |
shell: bash | |
run: | | |
cd build | |
lcov --list coverage.info | |
if: matrix.enable_coverage == 'on' | |
- name: publish Coveralls report | |
uses: coverallsapp/github-action@master | |
with: | |
path-to-lcov: ./build/coverage.info | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
if: matrix.enable_coverage == 'on' |