Merge branch 'main' of https://github.com/stigrs/scilib #97
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: Codecov | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: Debug | |
jobs: | |
build-linux: | |
strategy: | |
matrix: | |
compiler: [g++-10] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Prepare | |
run: sudo apt-get install gfortran libopenblas-dev liblapacke-dev lcov | |
- name: Configure CMake | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_COMPILER=${{matrix.compiler}} -DScilib_BUILD_BENCH=OFF -DScilib_CODE_COVERAGE=ON | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
run: ctest -C ${{env.BUILD_TYPE}} | |
- name: Code coverage | |
working-directory: ${{github.workspace}}/build | |
run: | | |
lcov --directory . --capture --output-file coverage.info | |
lcov --remove coverage.info '/usr/*' "${{github.workspace}}"'/build/_deps/*' "${{github.workspace}}"'/tests/*' -o coverage-info | |
lcov --list coverage.info | |
curl -Os https://uploader.codecov.io/latest/linux/codecov | |
chmod +x codecov | |
./codecov |