-
Notifications
You must be signed in to change notification settings - Fork 13
136 lines (121 loc) · 3.79 KB
/
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: ci
on:
pull_request:
release:
types: [published]
push:
branches:
- main
- develop
- master
jobs:
Test:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ${{ matrix.os }}
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
# Recommendations:
# * support at least 2 operating systems
# * support at least 2 compilers
# * make sure all supported configurations for your project are built
#
# Disable/enable builds in this list to meet the above recommendations
# and your own projects needs
matrix:
os:
- ubuntu-22.04
- macos-11
- windows-2022
compiler:
# you can specify the version after `-` like "llvm-13.0.0".
- llvm
- gcc
CMAKE_GENERATOR:
- "Ninja Multi-Config"
CPACK_GENERATOR:
- ZIP
task:
- build
# TODO: add tests and coverage tasks
- test
#- test:release
#- test:without-sanitizer
#- test:release:without-sanitizer
#- coverage
include:
# Inject GCOV variable for gcc
- compiler: gcc
GCOV: gcov
# Inject GCOV variable for llvm
- compiler: llvm
GCOV: "llvm-cov gcov"
# Only to test non-multiconfig builds
- os: ubuntu-22.04
compiler: gcc-13
CMAKE_GENERATOR: "Unix Makefiles"
GCOV: gcov-13
- os: windows-2022
compiler: msvc
CMAKE_GENERATOR: "Visual Studio 17 2022"
# To exclude a specific job from the matrix (e.g gcc on Windows), you can use this syntax.
# exclude:
# - os: windows-2022
# compiler: gcc
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Cache
uses: actions/cache@v3
with:
path: |
~/vcpkg
./build/vcpkg_installed
${{ env.CONAN_USER_HOME }}
~/.cache/pip
${{ env.HOME }}/.cache/vcpkg/archives
${{ env.XDG_CACHE_HOME }}/vcpkg/archives
${{ env.LOCALAPPDATA }}\vcpkg\archives
${{ env.APPDATA }}\vcpkg\archives
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ hashFiles('./vcpkg.json')}}-${{ matrix.CMAKE_GENERATOR }}-${{ matrix.task }}-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.compiler }}-${{ hashFiles('./vcpkg.json') }}-
- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.compiler }}
vcvarsall: ${{ contains(matrix.os, 'windows' )}}
cmake: true
ninja: true
vcpkg: true
ccache: true
clangtidy: true
task: true
cppcheck: true
gcovr: true
opencppcoverage: true
- name: Initialize CodeQL
if: ${{ contains(matrix.os, 'ubuntu') && contains(matrix.compiler, 'llvm') }}
uses: github/codeql-action/init@v2
with:
languages: "cpp"
- name: Build/Test/Coverage
run: |
task ${{matrix.task}}
env:
CMAKE_GENERATOR: ${{matrix.CMAKE_GENERATOR}}
GCOV: ${{matrix.GCOV}}
- name: Perform CodeQL Analysis
if: ${{ contains(matrix.os, 'ubuntu') && contains(matrix.compiler, 'llvm') }}
uses: github/codeql-action/analyze@v2
- name: Publish to codecov
if: ${{ contains(matrix.task, 'coverage') }}
uses: codecov/codecov-action@v2
with:
flags: ${{ runner.os }}
name: ${{ runner.os }}-coverage
files: ./build/coverage.xml