cleanup #42
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: Linux | |
on: [push, pull_request] | |
jobs: | |
build: | |
name: GCC-${{matrix.build_type}} | |
runs-on: ubuntu-24.04 | |
strategy: | |
fail-fast: true | |
matrix: | |
build_type: [Release, Debug] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Dependencies | |
shell: bash | |
run: | | |
sudo apt-get update | |
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y \ | |
build-essential \ | |
cmake \ | |
lcov \ | |
ninja-build | |
- name: Configure | |
shell: bash | |
run: | | |
if [[ ${{matrix.build_type}} == "Debug" ]]; then | |
export CXXFLAGS=--coverage | |
fi | |
cmake -S . -B build_${{matrix.build_type}} -G Ninja | |
- name: Build | |
run: | | |
cmake --build build_${{matrix.build_type}} \ | |
--config ${{matrix.build_type}} | |
- name: Test | |
run: | | |
./build_${{matrix.build_type}}/test_cpuidpp | |
- name: Generate Coverage | |
if: ${{ startswith(matrix.build_type, 'Debug') }} | |
run: | | |
lcov --directory . --capture --output-file coverage.info | |
lcov --remove coverage.info 'tests/*' '/usr/*' --output-file coverage.info | |
lcov --list coverage.info | |
- name: Upload Coverage to Codecov | |
if: ${{ startswith(matrix.build_type, 'Debug') }} | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
verbose: true |