Refactor to use a more functional style. #100
Workflow file for this run
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
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
name: Run unit tests | |
jobs: | |
build: | |
name: ${{ matrix.config.name }} | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { | |
name: "Ubuntu Latest GCC, OpenMP enabled", | |
os: ubuntu-latest, | |
omp: true | |
} | |
- { | |
name: "Ubuntu Latest GCC, coverage enabled", | |
os: ubuntu-latest, | |
cov: true | |
} | |
- { | |
name: "macOS Latest Clang", | |
os: macos-latest | |
} | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Get latest CMake | |
uses: lukka/get-cmake@latest | |
- name: Configure the build | |
if: ${{ ! matrix.config.cov && ! matrix.config.omp }} | |
run: cmake -S . -B build | |
- name: Configure the build with coverage | |
if: ${{ matrix.config.cov }} | |
run: cmake -S . -B build -DCODE_COVERAGE=ON | |
- name: Configure the build with OpenMP | |
if: ${{ matrix.config.omp }} | |
run: cmake -S . -B build -DUSE_OPENMP=ON | |
- name: Run the build | |
run: cmake --build build | |
- name: Run the tests | |
run: | | |
cd build | |
ctest | |
- name: Generate code coverage | |
if: ${{ matrix.config.cov }} | |
run: | | |
cd build/tests/CMakeFiles/libtest.dir/src/ | |
gcov -abcfu *.gcno | |
- name: Upload to Codecov | |
if: ${{ matrix.config.cov }} | |
uses: codecov/codecov-action@v1 | |
with: | |
directory: build/tests/CMakeFiles/libtest.dir/src/ |