-
Notifications
You must be signed in to change notification settings - Fork 1
88 lines (74 loc) · 2.22 KB
/
cpp-ci.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: C++ CI
on:
schedule:
- cron: '0 0 * * *'
push:
branches: [ main ]
tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ windows-latest, macos-latest, ubuntu-latest ]
env:
CTEST_OUTPUT_ON_FAILURE: 1
steps:
- uses: actions/checkout@v3
- name: Install dependencies on ubuntu
if: startsWith(matrix.os, 'ubuntu')
run: |
git clone https://github.com/microsoft/vcpkg build/vcpkg
./build/vcpkg/bootstrap-vcpkg.sh
- name: Install dependencies on macos
if: startsWith(matrix.os, 'macos')
run: |
brew install pkg-config
git clone https://github.com/microsoft/vcpkg build/vcpkg
./build/vcpkg/bootstrap-vcpkg.sh
- name: Install dependencies on windows
if: startsWith(matrix.os, 'windows')
run: |
git clone https://github.com/microsoft/vcpkg build/vcpkg
.\build\vcpkg\bootstrap-vcpkg.bat
- name: Build
shell: bash
run: |
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=./build/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build build --parallel 4
- name: Test
working-directory: build
run: ctest -j4
coverage:
needs: [ test ]
runs-on: ubuntu-latest
env:
CXXFLAGS: "--coverage -fno-inline"
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
git clone https://github.com/microsoft/vcpkg build/vcpkg
./build/vcpkg/bootstrap-vcpkg.sh
- name: Build
shell: bash
run: |
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=./build/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build build --parallel 4
- name: Test
working-directory: build
run: ctest -j4
- name: lcov
working-directory: build
run: |
sudo apt install lcov
lcov -c -d . -o cov.info
lcov --remove cov.info */test/* --output-file cov.info
lcov -l cov.info
- name: codecov
working-directory: build
shell: bash
run: bash <(curl -s https://codecov.io/bash) -f cov.info