-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
26 additions
and
26 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,40 +7,44 @@ on: | |
pull_request: | ||
|
||
jobs: | ||
ubuntu-llvm-code-cov: | ||
ubuntu-gcc-code-cov: | ||
runs-on: ubuntu-latest | ||
env: | ||
CMAKE_FLAGS: "-DSERDEPP_USE_NLOHMANN_JSON=ON -DSERDEPP_USE_TOML11=ON -DSERDEPP_USE_YAML-CPP=ON -DSERDEPP_USE_RAPIDJSON=ON -DSERDEPP_USE_FMT=ON -DSERDEPP_BUILD_TESTING=ON -DSERDEPP_USE_CATCH2=ON" | ||
strategy: | ||
matrix: | ||
build-type: ["Debug"] | ||
clang-version: ["latest"] | ||
container: silkeh/clang:${{ matrix.clang-version }} | ||
container: gcc:${{ matrix.gcc-version }} | ||
steps: | ||
- name: Get latest CMake | ||
uses: lukka/[email protected] | ||
|
||
- name: Install git on container | ||
run: apt update && apt install -y git | ||
- name: Clone Repository | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: CMake build | ||
run: | | ||
cmake -Bbuild -DCMAKE_BUILD_TYPE=${{matrix.build-type}} ${{env.CMAKE_FLAGS}} . | ||
cd build | ||
cmake --build . --config ${{matrix.build-type}} | ||
- name: Generate Coverage Report | ||
cmake --build ./build --config ${{matrix.build-type}} | ||
- name: Run Test Script | ||
working-directory: build | ||
run: ctest -C ${{matrix.build-type}} --output-on-failure | ||
|
||
- name: Prepare Codecov | ||
run: | | ||
cd build/${{matrix.build-type}} | ||
./unittest | ||
llvm-profdata-${{matrix.clang-version}} merge -sparse default.profraw -o default.profdata | ||
llvm-cov-${{matrix.clang-version}} export ./unittest --instr-profile default.profdata -format=lcov >> lcov.info | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v2 | ||
sudo apt-get install -y lcov | ||
lcov --directory . --capture --output-file coverage.info --rc lcov_branch_coverage=1 # capture coverage info | ||
lcov --remove coverage.info '/usr/*' --output-file coverage.info --rc lcov_branch_coverage=1 # filter out system | ||
lcov --list coverage.info --rc lcov_branch_coverage=1 # debug info | ||
- name: Codecov | ||
uses: codecov/codecov-action@v3.1.1 | ||
with: | ||
directory: ./build/${{matrix.build-type}} | ||
files: lcov.info | ||
flags: unittest | ||
files: coverage.info | ||
fail_ci_if_error: true | ||
verbose: true |
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
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