-
Notifications
You must be signed in to change notification settings - Fork 4
55 lines (45 loc) · 1.83 KB
/
build.yaml
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
name: build
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
BUILD_TYPE: ["Debug", "Release"]
os: [ windows-latest ]
steps:
- uses: actions/checkout@v2
- name: Get MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Get specific version CMake, v3.21.2
uses: lukka/[email protected]
- name: Setup vcpkg (it does not install any package yet)
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: 01f602195983451bc83e72f4214af2cbc495aa94
- name: Get OpenCppCoverage
if: ${{ matrix.BUILD_TYPE == 'Debug' }}
env:
myUrl: "https://github.com/OpenCppCoverage/OpenCppCoverage/releases/download/release-0.9.9.0/OpenCppCoverageSetup-x64-0.9.9.0.exe"
run: |
powershell.exe -Command "Invoke-WebRequest $env:myUrl -OutFile $env:Temp/OpenCppCoverageSetup-x64-0.9.9.0.exe"
powershell.exe -Command "& $env:Temp/OpenCppCoverageSetup-x64-0.9.9.0.exe /silent"
powershell.exe -Command "Add-Content $env:GITHUB_PATH 'C:\Program Files\OpenCppCoverage'"
- name: run cmake
run: >
cmake . -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} -B build
- name: run build
run: cmake --build build --config ${{ matrix.BUILD_TYPE }}
- name: run test
run: ctest -C ${{ matrix.BUILD_TYPE }} --test-dir build --verbose --repeat until-pass:3 --timeout 30 --output-on-failure
- name: run test with coverage
if: ${{ matrix.BUILD_TYPE == 'Debug' }}
run: >
cmake --build build --config ${{ matrix.BUILD_TYPE }} --target coverage
- name: Upload Report to Codecov
if: ${{ matrix.BUILD_TYPE == 'Debug' }}
uses: codecov/codecov-action@v4
with:
files: ./cobertura.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }} # required