Skip to content

Tests

Tests #291

Workflow file for this run

name: Tests
on:
workflow_run:
workflows:
- Builds
types:
- completed
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
# triplet: [x64-linux, x64-linux-clang, x64-linux-clang-libcxx]
# STORAGE: [Contiguous]
# LIBCXX: [OFF]
# compiler: [g++]
include:
- preset: gcc-eigen-release
STORAGE: Contiguous
- preset: clang-eigen-release
STORAGE: Contiguous
- preset: clang-libcxx-eigen-release
STORAGE: Contiguous
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- run: sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
- run: sudo apt-get update
- run: sudo apt-get install openmpi-bin libopenmpi-dev
- run: sudo apt-get install lcov
- run: sudo apt-get install libopenblas-dev
- run: sudo apt-get install liblapacke-dev
- run: sudo apt-get install libomp-15-dev
- run: sudo apt-get install libc++abi1-15
- run: sudo apt-get install libc++1-15
- run: sudo apt-get install libc++abi-15-dev
- run: sudo apt-get install libc++-15-dev
# - name: Set up GCC
# uses: egor-tensin/setup-gcc@v1
# with:
# version: 10
# platform: x64
- run: g++ --version
- run: sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-15 100
- run: sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 100
- run: sudo update-alternatives --set clang++ /usr/bin/clang++-15
- run: sudo update-alternatives --set clang /usr/bin/clang-15
- run: clang++ --version
- uses: lukka/get-cmake@latest
- name: Restore artifacts, or setup vcpkg (do not install any package)
uses: lukka/run-vcpkg@v11
- name: Run CMake+vcpkg+Ninja
uses: lukka/run-cmake@v10
with:
configurePreset: ${{ matrix.preset }}
configurePresetAdditionalArgs: "['-DBLA_VENDOR=OpenBLAS', '-DXPED_USE_OPENMP=OFF', '-DXPED_ENABLE_COVERAGE=ON', '-DXPED_STORAGE=${{ matrix.STORAGE }}']"
buildPreset: ${{ matrix.preset }}
testPreset: ${{ matrix.preset }}
- name: Generate coverage report
if: matrix.preset == 'gcc-eigen-release'
working-directory: ${{runner.workspace}}/${{ matrix.preset }}
run: |
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter system-files
lcov --remove coverage.info '${{runner.workspace}}/${{ matrix.preset }}/vcpkg_installed/*' --output-file coverage.info # filter system-files
lcov --list coverage.info # debug info
- name: Upload coverage to Codecov
if: matrix.preset == 'gcc-eigen-release'
uses: codecov/codecov-action@v3
with:
token: 6604ed1a-6dd1-4021-8450-93cb22163632
files: ${{runner.workspace}}/${{ matrix.preset }}/coverage.info
directory: ${{runner.workspace}}/${{ matrix.preset }}/tests
flags: unittests
name: coverage
fail_ci_if_error: true
verbose: true