ignore 'example' from coverage statistics #124
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: Build and test pkg | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
gcc_v: [10] # Version of GFortran we want to use. | |
include: | |
- os: ubuntu-latest | |
os-arch: linux-x86_64 | |
env: | |
FC: gfortran | |
GCC_V: ${{ matrix.gcc_v }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install GFortran Linux | |
if: contains(matrix.os, 'ubuntu') | |
run: | | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \ | |
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \ | |
--slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V} | |
- name: Install fpm | |
uses: fortran-lang/setup-fpm@v5 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
fpm-version: 'v0.10.1' | |
- name: Build with coverage info | |
run: | | |
gfortran --version | |
rm -rf ./build/gfortran* | |
fpm test --profile debug --flag "--coverage -fopenmp" --verbose | |
gcov ./build/gfortran*/hrweno/src*.gcda -r ./src/ -b -w | |
- name: Run examples | |
run: | | |
gfortran --version | |
fpm run --example "example1*" --profile release --flag "-fopenmp" | |
fpm run --example "example2*" --profile release --flag "-fopenmp" | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
verbose: true |