-
Notifications
You must be signed in to change notification settings - Fork 35
78 lines (67 loc) · 2.17 KB
/
ubuntu.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
name: Ubuntu
on:
pull_request:
release:
types: [published]
push:
tags:
branches:
- main
env:
CTEST_OUTPUT_ON_FAILURE: 1
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: update vcpkg
run: |
git submodule add https://github.com/Microsoft/vcpkg.git vcpkg
git submodule update --remote --recursive
git submodule foreach git pull origin master
./vcpkg/bootstrap-vcpkg.sh
- name: Setup Cache
uses: actions/cache@v2
with:
key: ${{ runner.os }}-${{ github.workflow }}-${{ env.BUILD_TYPE }}-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('./vcpkg.json')}}
restore-keys: |
${{ runner.os }}-${{ env.BUILD_TYPE }}-
path: |
./vcpkg
~/vcpkg
./build/vcpkg_installed
${{ env.HOME }}/.cache/vcpkg/archives
${{ env.XDG_CACHE_HOME }}/vcpkg/archives
${{ env.LOCALAPPDATA }}\vcpkg\archives
${{ env.APPDATA }}\vcpkg\archives
"**/cpm_modules"
- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
vcvarsall: false
cmake: true
ninja: true
conan: false
vcpkg: false
ccache: true
clangtidy: false
cppcheck: true
gcovr: true
opencppcoverage: false
gcc: '11'
- name: Configure CMake
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Build
run: cmake --build build -j4
- name: Test and coverage
working-directory: ./build
run: |
ctest --build-config Debug
gcovr -j 4 --delete --root ../ --print-summary --xml-pretty --xml coverage.xml . --gcov-executable gcov
# TODO: add coverage
#- name: Collect code coverage
# run: bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"