-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (36 loc) · 1.47 KB
/
Copy pathcpp-unit-tests.yml
File metadata and controls
46 lines (36 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: C++ Unit Tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
env:
BUILD_TYPE: Release
steps:
- uses: actions/checkout@v4
- name: Install CMake
uses: lukka/get-cmake@latest
with:
cmakeVersion: "latest"
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DUNICODE_WIDTH_APPROXIMATION_ENABLE_TESTS=ON -DUNICODE_WIDTH_APPROXIMATION_ENABLE_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}} --output-on-failure
- name: Install Coverage
run: sudo apt-get update && sudo apt-get install -y lcov
- name: Coverage
run: |
ls -lh ${{github.workspace}}/build
lcov --directory ${{github.workspace}}/build --capture --output-file ${{github.workspace}}/build/coverage.info --ignore-errors mismatch --rc geninfo_unexecuted_blocks=1
lcov --remove ${{github.workspace}}/build/coverage.info '/usr/*' '*/_deps/*' 'tests/' --output-file ${{github.workspace}}/build/coverage.info
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ${{github.workspace}}/build/coverage.info