-
Notifications
You must be signed in to change notification settings - Fork 23
62 lines (51 loc) · 1.62 KB
/
cpp-tests.yml
File metadata and controls
62 lines (51 loc) · 1.62 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: cpp-tests
on:
push:
branches:
- master
paths-ignore:
- "*.md"
pull_request:
paths-ignore:
- "*.md"
workflow_dispatch:
env:
SOURCE_DIR: ./Sources/backend-cpp
BUILD_DIR: ./Sources/backend-cpp/build
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- name: CMake
run: cmake -S ${{env.SOURCE_DIR}} -B ${{env.BUILD_DIR}} -A x64 -DBUILD_TESTING=ON -DBUILD_TOOLS=OFF
- name: Build
run: cmake --build ${{env.BUILD_DIR}} --config RelWithDebInfo
- name: Setup OpenCppCoverage and add to PATH
id: setup_opencppcoverage
run: |
choco install OpenCppCoverage -y
echo "C:\Program Files\OpenCppCoverage" >> $env:GITHUB_PATH
- name: Run C++ Unit Tests and Generate Coverage Report
id: generate_test_report
shell: cmd
run: |
OpenCppCoverage.exe ^
--quiet ^
--sources Sources\backend-cpp ^
--excluded_sources Vendor ^
--excluded_sources Windows ^
--excluded_sources Tools ^
--export_type cobertura:StreamdeckDcsInterfaceCov.xml ^
--cover_children ^
-- ctest --test-dir ./${{env.BUILD_DIR}} -C RelWithDebInfo --output-on-failure
- name: Upload Report to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./StreamdeckDcsInterfaceCov.xml
flags: Cpp
disable_search: true