-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (51 loc) · 1.58 KB
/
run-tests.yml
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
62
63
name: Tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
BUILD_TYPE: Debug
INSTALL_LOCATION: ".local"
jobs:
build:
runs-on: windows-latest
# Let's allow bypassing tests
if: "!contains(github.event.head_commit.message, '[skip tests]')"
steps:
- name: Install OpenCppCoverage
run: |
choco install OpenCppCoverage -y
echo "C:\Program Files\OpenCppCoverage" >> $env:GITHUB_PATH
- name: Install GoogleTest
run: |
git clone https://github.com/google/googletest.git --branch release-1.10.0
pushd googletest
cmake -Bbuild -DCMAKE_INSTALL_PREFIX="$HOME/$env:INSTALL_LOCATION" -Dgtest_force_shared_crt=1
cmake --build build --config "$env:BUILD_TYPE"
cmake --build build --target install --config "$env:BUILD_TYPE"
popd
- name: Checkout
uses: actions/checkout@v3
- name: Configure
run: cmake -Bbuild -DCMAKE_INSTALL_PREFIX="$HOME/$env:INSTALL_LOCATION"
- name: Build
run: cmake --build build --config "$env:BUILD_TYPE" -j4
- name: Run tests
run: |
pushd build
ctest -C "$env:BUILD_TYPE" -VV
popd
- name: Running coverage analysis
run: |
pushd build
.\coverage.cmd
popd
- name: Processing coverage result
uses: codecov/codecov-action@v3
with:
files: ./build/coverage-report.xml
flags: unittests
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
functionalities: fix