-
Notifications
You must be signed in to change notification settings - Fork 1
131 lines (114 loc) · 3.32 KB
/
build.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
name: "build"
on:
pull_request:
release:
types: [published]
push:
branches:
- main
- develop
jobs:
Build:
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
matrix:
os:
- ubuntu-22.04
- macos-12
- windows-2022
compiler:
- llvm-15.0.2
- gcc-12
CMAKE_BUILD_TYPE:
- Debug
- Release
CMAKE_GENERATOR:
- "Ninja Multi-Config"
CPACK_GENERATOR:
- ZIP
exclude:
- os: ubuntu-22.04
compiler: llvm-15.0.2
- os: windows-2022
compiler: gcc-12
- os: macos-12
compiler: gcc-12
include:
- compiler: gcc-12
GCOV: gcov-12
- compiler: llvm-15.0.2
GCOV: "llvm-cov gcov"
- os: ubuntu-22.04
compiler: gcc-12
CMAKE_BUILD_TYPE: Release
CMAKE_GENERATOR: "Unix Makefiles"
GCOV: gcov-12
- os: windows-2022
compiler: msvc
CMAKE_BUILD_TYPE: Debug
CMAKE_GENERATOR: "Visual Studio 17 2022"
- os: windows-2022
compiler: msvc
CMAKE_BUILD_TYPE: Release
CMAKE_GENERATOR: "Visual Studio 17 2022"
steps:
- uses: actions/checkout@v3
with:
lfs: true
submodules: recursive
- name: Setup Cache
uses: ./.github/actions/setup_cache
with:
compiler: ${{ matrix.compiler }}
CMAKE_BUILD_TYPE: ${{ matrix.CMAKE_BUILD_TYPE }}
CMAKE_GENERATOR: ${{ matrix.CMAKE_GENERATOR }}
- name: Setup Cpp
id: setup_cpp
uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.compiler }}
vcvarsall: ${{ contains(matrix.os, 'windows') }}
ccache: true
cmake: true
gcovr: true
ninja: true
opencppcoverage: true
task: true
- name: Coverage
if: "matrix.CMAKE_BUILD_TYPE == 'Debug'"
run: task coverage
env:
CMAKE_BUILD_TYPE: ${{ matrix.CMAKE_BUILD_TYPE }}
CMAKE_GENERATOR: ${{ matrix.CMAKE_GENERATOR }}
GCOV: ${{ matrix.GCOV }}
- name: Test
if: "matrix.CMAKE_BUILD_TYPE == 'Release'"
run: task test
env:
CMAKE_BUILD_TYPE: ${{ matrix.CMAKE_BUILD_TYPE }}
CMAKE_GENERATOR: ${{ matrix.CMAKE_GENERATOR }}
GCOV: ${{ matrix.GCOV }}
- name: Install
if: "matrix.CMAKE_BUILD_TYPE == 'Release'"
run: task install
env:
CMAKE_GENERATOR: ${{ matrix.CMAKE_GENERATOR }}
CPACK_GENERATOR: ${{ matrix.CPACK_GENERATOR }}
- name: Publish Tagged Release
uses: softprops/action-gh-release@v1
if: "startsWith(github.ref, 'refs/tags/') && matrix.CMAKE_BUILD_TYPE == 'Release'"
with:
files: build/*-*Release*-*.*
- name: Publish to codecov
if: "matrix.CMAKE_BUILD_TYPE == 'Debug'"
uses: codecov/codecov-action@v2
with:
flags: ${{ runner.os }}
name: ${{ runner.os }}-coverage
files: ./build/coverage.xml