Skip to content

Fixed: Various minor issues as reported by codacy #131

Fixed: Various minor issues as reported by codacy

Fixed: Various minor issues as reported by codacy #131

Workflow file for this run

name: coverage
on:
push:
paths:
- '**.cpp'
- '**.h'
- '**.hpp'
- '**/CMakeLists.txt'
- '**.cmake'
- 'build.yml'
- 'coverage.yml'
pull_request:
paths:
- '**.cpp'
- '**.h'
- '**.hpp'
- '**/CMakeLists.txt'
- '**.cmake'
- 'build.yml'
- 'coverage.yml'
workflow_dispatch:
jobs:
codecov:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt update
sudo apt install clang llvm
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ccache-${{runner.os}}-clang-Debug
create-symlink: true
- name: Compile tests
env:
CC: ccache clang
CXX: ccache clang++
run: |
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_FLAGS_DEBUG="-fno-inline -fno-default-inline -fno-elide-constructors -fprofile-instr-generate -fcoverage-mapping" \
-DGAIA_BUILD_UNITTEST=ON \
-DGAIA_BUILD_EXAMPLES=OFF \
-DGAIA_BUILD_BENCHMARK=OFF \
-DGAIA_GENERATE_CC=OFF \
-S . -B ${{github.workspace}}/build
cmake --build ${{github.workspace}}/build --config Debug
- name: Run tests
working-directory: ${{github.workspace}}/build/src/test
run: |
LLVM_PROFILE_FILE="${{github.workspace}}/build/src/test/default.profraw" ./gaia_test
- name: Generate coverage data
working-directory: ${{github.workspace}}/build/src/test
run: |
llvm-profdata merge -sparse default.profraw -o coverage.profdata
llvm-cov export ./gaia_test \
-instr-profile=coverage.profdata \
-format=lcov > ${{github.workspace}}/build/coverage.info
llvm-cov report ./gaia_test -instr-profile=coverage.profdata
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{secrets.CODECOV_TOKEN}}
files: ${{github.workspace}}/build/coverage.info
name: gaia-ecs
fail_ci_if_error: true