Add jobs to test install w/ MPI #75
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: Test of package installation & execution | ||
'on': | ||
push: | ||
branches-ignore: | ||
- gh-pages | ||
tags: | ||
- '*' | ||
schedule: | ||
- cron: 0 10 * * 1 | ||
jobs: | ||
build_cxx: | ||
runs-on: ${{ matrix.os }} | ||
defaults: | ||
run: | ||
Check failure on line 14 in .github/workflows/test-suite.yml GitHub Actions / Test of package installation & executionInvalid workflow file
|
||
shell: bash -el {0} | ||
strategy: | ||
matrix: | ||
sundials-version: [latest] | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
with-coverage: [false, true] | ||
with-asan: [false, true] | ||
with-elf: [false] | ||
with-valgrind: [false, true] | ||
with-mpi: [false] | ||
include: | ||
- sundials-version: "5.7.0" | ||
os: ubuntu-latest | ||
with-coverage: false | ||
with-asan: false | ||
with-elf: false | ||
with-valgrind: false | ||
with-mpi: false | ||
- sundials-version: "6.7.0" | ||
os: ubuntu-latest | ||
with-coverage: false | ||
with-asan: false | ||
with-elf: false | ||
with-valgrind: false | ||
with-mpi: false | ||
- sundials-version: "7.1.1" | ||
os: ubuntu-latest | ||
with-coverage: false | ||
with-asan: false | ||
with-elf: false | ||
with-valgrind: false | ||
with-mpi: false | ||
- sundials-version: latest | ||
os: ubuntu-latest | ||
with-coverage: false | ||
with-asan: false | ||
with-elf: false | ||
with-valgrind: false | ||
with-mpi: true | ||
- sundials-version: "6.7.0" | ||
os: ubuntu-latest | ||
with-coverage: false | ||
with-asan: false | ||
with-elf: false | ||
with-valgrind: false | ||
with-mpi: true | ||
- sundials-version: "7.1.1" | ||
os: ubuntu-latest | ||
with-coverage: false | ||
with-asan: false | ||
with-elf: false | ||
with-valgrind: false | ||
with-mpi: tru | ||
exclude: | ||
- os: windows-latest | ||
with-asan: true | ||
- os: ubuntu-latest | ||
with-asan: true | ||
- os: windows-latest | ||
with-valgrind: true | ||
- os: windows-latest | ||
with-elf: true | ||
- os: macos-latest | ||
with-valgrind: true | ||
- os: macos-latest | ||
with-elf: true | ||
- with-valgrind: true | ||
with-elf: true | ||
- with-valgrind: true | ||
with-asan: true | ||
- with-coverage: true | ||
with-valgrind: true | ||
- with-coverage: true | ||
with-asan: true | ||
fail-fast: false | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
################################### | ||
# CONDA SETUP | ||
################################### | ||
- name: Set up MSVC Compiler on windows | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
if: matrix.os == 'windows-latest' | ||
- name: Set up miniconda test environment (W/O MPI) | ||
if: matrix.with-mpi == false | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
activate-environment: ephoto | ||
environment-file: environment.yml | ||
auto-update-conda: true | ||
channels: conda-forge | ||
channel-priority: strict | ||
miniforge-version: latest | ||
use-mamba: true | ||
mamba-version: "1.5.10" | ||
conda-remove-defaults: true | ||
- name: Set up miniconda test environment (W/ MPI) | ||
if: matrix.with-mpi == true | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
activate-environment: ephoto | ||
environment-file: environment_mpi.yml | ||
auto-update-conda: true | ||
channels: conda-forge | ||
channel-priority: strict | ||
miniforge-version: latest | ||
use-mamba: true | ||
mamba-version: "1.5.10" | ||
conda-remove-defaults: true | ||
- name: Set USERPROFILE | ||
if: matrix.os == 'windows-latest' | ||
run: | | ||
echo "USERPROFILE=${{ github.workspace }}" >> "$GITHUB_ENV" | ||
- name: Install specific version of Sundials via conda | ||
if: matrix.sundials-version != 'latest' && matrix.with-mpi == false | ||
run: | | ||
mamba install sundials==${{ matrix.sundials-version }} -y | ||
- name: Check mamba installation | ||
run: | | ||
mamba info | ||
mamba list | ||
- name: Install doxgen on unix systems | ||
if: matrix.os != 'windows-latest' | ||
run: | | ||
mamba install doxygen>=1.9.2 graphviz -y | ||
- name: Install compilers using conda on Linux/Mac | ||
if: matrix.os != 'windows-latest' && matrix.with-valgrind != true | ||
run: | | ||
mamba install c-compiler cxx-compiler | ||
- name: Install valgrind on unix systems (and required debug symbols) | ||
if: matrix.os != 'windows-latest' && matrix.with-valgrind == true | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install libc6-dbg | ||
mamba install valgrind | ||
################################### | ||
# INSTALL SUNDIALS W/ MPI | ||
################################### | ||
- name: CMake flags for building Sundials W/ MPI | ||
shell: bash -l {0} | ||
if: matrix.with-mpi == true | ||
run: | | ||
CMAKE_BUILD_TYPE_TEST="RelWithDebInfo" | ||
echo "CMAKE_BUILD_TYPE_TEST=RelWithDebInfo" >> "$GITHUB_ENV" | ||
echo "CMAKE_ARGS=-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DENABLE_MPI:BOOL=ON" >> "$GITHUB_ENV" | ||
- name: Clone Sundials for build W/ MPI | ||
if: matrix.with-mpi == true | ||
run: | | ||
git clone https://github.com/LLNL/sundials.git | ||
- name: Check out specific version of Sundials for build W/ MPI | ||
if: matrix.sundials-version != 'latest' && matrix.with-mpi == true | ||
run: | | ||
cd sundials | ||
git checkout tags/v${{ matrix.sundials-version }} -b tagged | ||
- name: Configure Sundials W/ MPI | ||
if: matrix.with-mpi == true | ||
run: | | ||
cd sundials | ||
mkdir build | ||
cd build | ||
cmake .. -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON | ||
- name: Build Sundials W/ MPI in parallel (CONDA, UNIX) | ||
if: matrix.with-mpi == true && matrix.os != 'windows-latest' | ||
run: | | ||
cd sundials/build | ||
cmake --build . --config ${{ env.CMAKE_BUILD_TYPE_TEST }} -- -j 4 | ||
- name: Build Sundials W/ MPI in serial (CONDA, WINDOWS) | ||
if: matrix.with-mpi == true && matrix.os == 'windows-latest' | ||
run: | | ||
cd sundials/build | ||
cmake --build . --config ${{ env.CMAKE_BUILD_TYPE_TEST }} | ||
- name: Install Sundials W/ MPI | ||
if: matrix.with-mpi == true | ||
run: | | ||
cd sundials/build | ||
cmake --install . | ||
################################### | ||
# PIP INSTALL THINGS | ||
################################### | ||
- name: Install packages not current on conda-forge (gcovr) | ||
if: matrix.with-coverage == true | ||
run: | | ||
pip install gcovr | ||
################################### | ||
# SET CONFIG FLAGS | ||
################################### | ||
- name: Global config flags | ||
run: | | ||
CMAKE_BUILD_TYPE_TEST="Debug" | ||
echo "CMAKE_BUILD_TYPE_TEST=Debug" >> "$GITHUB_ENV" | ||
echo "CMAKE_ARGS=-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON" >> "$GITHUB_ENV" | ||
echo "CMAKE_ARGS_TEST=-DBUILD_TESTS=ON" >> "$GITHUB_ENV" | ||
echo "TEST_FLAGS=-C ${CMAKE_BUILD_TYPE_TEST} --output-on-failure -VV" >> "$GITHUB_ENV" | ||
- name: Coverage config flags | ||
if: matrix.with-coverage == true && matrix.os != 'windows-latest' | ||
run: | | ||
echo "CMAKE_ARGS_TEST=${{ env.CMAKE_ARGS_TEST }} -DTEST_COVERAGE=ON" >> "$GITHUB_ENV" | ||
- name: ASAN config flags | ||
if: matrix.with-asan == true | ||
run: | | ||
echo "CMAKE_ARGS=${{ env.CMAKE_ARGS }} -DWITH_ASAN=ON" >> "$GITHUB_ENV" | ||
echo "ASAN_OPTIONS=detect_odr_violation=0:detect_container_overflow=0" >> $GITHUB_ENV | ||
echo "TEST_FLAGS=${{ env.TEST_FLAGS }} -E valgrind*" >> "$GITHUB_ENV" | ||
- name: ASAN dynamic library | ||
if: matrix.with-asan == true && matrix.os == 'macos-latest' | ||
run: | | ||
echo "DYLD_INSERT_LIBRARIES=$(clang -print-file-name=libclang_rt.asan_osx_dynamic.dylib)" >> "$GITHUB_ENV" | ||
- name: ELF config flags | ||
if: matrix.with-elf == true | ||
run: | | ||
echo "CMAKE_ARGS_TEST=${{ env.CMAKE_ARGS_TEST }} -DTEST_ELF=ON" >> "$GITHUB_ENV" | ||
- name: Valgrind off config flags | ||
if: matrix.with-valgrind == true | ||
run: | | ||
echo "CMAKE_ARGS_TEST=${{ env.CMAKE_ARGS_TEST }} -DTEST_VALGRIND=ON" >> "$GITHUB_ENV" | ||
################################### | ||
# Add paths for Windows dlls | ||
################################### | ||
- name: Conda library paths on Windows | ||
if: matrix.os == 'windows-latest' | ||
run: | | ||
# This isn't necessary, but it speeds up the build | ||
LIB_DIRECTORY="${CONDA_PREFIX}/Library/lib" | ||
ls ${LIB_DIRECTORY} | ||
echo "${LIB_DIRECTORY}" >> $GITHUB_PATH | ||
DLL_DIRECTORY="${CONDA_PREFIX}/Library/bin" | ||
ls ${DLL_DIRECTORY} | ||
echo "${DLL_DIRECTORY}" >> $GITHUB_PATH | ||
################################### | ||
# Configure | ||
################################### | ||
- name: Configure (CONDA) | ||
run: | | ||
mkdir build | ||
cd build | ||
which cmake | ||
cmake .. ${{ env.CMAKE_ARGS }} ${{ env.CMAKE_ARGS_NO_PYTHON }} ${{ env.CMAKE_ARGS_TEST }} | ||
################################### | ||
# Build CXX | ||
################################### | ||
- name: Build C++ & C in parallel (CONDA, UNIX) | ||
if: matrix.os != 'windows-latest' | ||
run: | | ||
cd build | ||
cmake --build . --config ${{ env.CMAKE_BUILD_TYPE_TEST }} -- -j 4 | ||
- name: Build C++ & C in serial (CONDA, WINDOWS) | ||
if: matrix.os == 'windows-latest' | ||
run: | | ||
cd build | ||
cmake --build . --config ${{ env.CMAKE_BUILD_TYPE_TEST }} | ||
################################### | ||
# Test CXX | ||
################################### | ||
- name: Test C++ | ||
if: matrix.with-coverage != true | ||
run: | | ||
mamba list | ||
echo "PATH=$PATH" | ||
cd build | ||
which ctest | ||
ctest ${{ env.TEST_FLAGS }} | ||
- name: Test C++ (COVERAGE) | ||
if: matrix.with-coverage && matrix.os != 'windows-latest' | ||
run: | | ||
mamba list | ||
echo "PATH=$PATH" | ||
cd build | ||
make coverage | ||
- name: Preserve coverage information | ||
if: matrix.with-coverage && matrix.os != 'windows-latest' | ||
run: | | ||
cp -r build/coverage coverage | ||
################################### | ||
# Build Python | ||
################################### | ||
# - name: Set CMAKE_ARGS for Python build | ||
# run: | | ||
# echo "OLD_CMAKE_ARGS=${{ env.CMAKE_ARGS }}" >> "$GITHUB_ENV" | ||
# echo "CMAKE_ARGS=${{ env.CMAKE_ARGS }} -DBUILD_PYTHON=ON" >> "$GITHUB_ENV" | ||
# - name: Build Python (CONDA) | ||
# run: | | ||
# cd build | ||
# which cmake | ||
# cmake .. ${{ env.CMAKE_ARGS }} ${{ env.CMAKE_ARGS_TEST }} | ||
# - name: Unset CMAKE_ARGS for Python build | ||
# run: | | ||
# echo "CMAKE_ARGS=${{ env.OLD_CMAKE_ARGS }}" >> "$GITHUB_ENV" | ||
################################### | ||
# Test Python | ||
################################### | ||
# - name: Test Python Interfaces (CONDA) | ||
# if: matrix.with-elf == false && matrix.with-valgrind == false | ||
# run: | | ||
# pytest -sv tests/python | ||
################################### | ||
# Docs tests | ||
################################### | ||
- name: Build docs | ||
if: matrix.os != 'windows-latest' | ||
run: | | ||
python scripts/devtasks.py docs --rebuild | ||
################################### | ||
# Coverage | ||
################################### | ||
- name: Upload coverage report | ||
if: matrix.with-coverage == true && matrix.os != 'windows-latest' | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
name: ${{ matrix.os }}-${{ matrix.with-coverage }}-${{ matrix.with-asan }}-${{ matrix.with-elf }}-${{ matrix.with-valgrind }} | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: coverage/coverage.info | ||
functionalities: gcov |