-
Notifications
You must be signed in to change notification settings - Fork 29
264 lines (261 loc) · 8.4 KB
/
main.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
name: "main"
on: # @see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events
push:
branches: # Array of patterns that match refs/heads
- main
pull_request:
branches: [main]
jobs:
format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: CI Job
shell: bash
run: |
bash ci/do_ci.sh format ;
unix_build: # job id, can be any string
name: Unix Build
# This job runs on Linux
strategy:
matrix:
include:
- os: ubuntu-latest
triplet: x64-linux
cc: gcc
- os: ubuntu-latest
triplet: x64-linux
cc: gcc
ci_mode: mbedtls
- os: ubuntu-latest
triplet: x64-linux
cc: gcc
ci_mode: libressl
- os: ubuntu-latest
triplet: x64-linux
cc: gcc
ci_mode: boringssl
- os: ubuntu-latest
triplet: x64-linux
cc: gcc
ci_mode: openssl-1.1.1
- os: ubuntu-latest
triplet: x64-linux
cc: gcc
ci_mode: no-rtti
- os: ubuntu-latest
triplet: x64-linux
cc: gcc
ci_mode: no-exceptions
- os: ubuntu-latest
triplet: x64-linux
cc: gcc-latest
- os: ubuntu-20.04
triplet: x64-linux
cc: gcc-4.8
- os: ubuntu-latest
triplet: x64-linux
cc: clang-latest
- os: macos-latest
triplet: x64-osx
cc: clang-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate cache key
shell: bash
run: git submodule > '.github/.cache-key'
- name: Cache packages
uses: actions/cache@v3
with:
path: |
/usr/local/share/vcpkg/installed
third_party/install
key: ${{ matrix.os }}-${{ matrix.cc }}-${{ matrix.ci_mode }}-${{ hashFiles('.github/.cache-key') }}
- name: Build & Test
shell: bash
env:
USE_CC: ${{ matrix.cc }}
VCPKG_TARGET_TRIPLET: ${{ matrix.triplet }}
CI_MODE: ${{ matrix.ci_mode }}
run: |
# The OpenSSL config package in apple ci job is break
if [ -e /opt/homebrew/lib/cmake/OpenSSL ]; then
rm -rf /opt/homebrew/lib/cmake/OpenSSL || true
fi
if [[ "xgcc-4.8" == "x$USE_CC" ]]; then
sudo apt-add-repository 'deb http://archive.ubuntu.com/ubuntu/ xenial main'
sudo apt-add-repository 'deb http://archive.ubuntu.com/ubuntu/ xenial universe'
sudo apt-get update ;
sudo apt-get install --no-install-recommends --no-install-suggests -y g++-4.8 ;
bash ci/do_ci.sh gcc.legacy.test ;
elif [[ "x$CI_MODE" == "xno-rtti" ]]; then
bash ci/do_ci.sh gcc.no-rtti.test ;
elif [[ "x$CI_MODE" == "xno-exceptions" ]]; then
bash ci/do_ci.sh gcc.no-exceptions.test ;
elif [[ "x$CI_MODE" == "xmbedtls" ]]; then
bash ci/do_ci.sh ssl.mbedtls ;
elif [[ "x$CI_MODE" == "xlibressl" ]]; then
bash ci/do_ci.sh ssl.libressl ;
elif [[ "x$CI_MODE" == "xboringssl" ]]; then
bash ci/do_ci.sh ssl.boringssl ;
elif [[ "x$CI_MODE" == "xopenssl-1.1.1" ]]; then
bash ci/do_ci.sh ssl.openssl-1.1.1 ;
else
bash ci/do_ci.sh ssl.openssl ;
fi
vs2019_2022_build: # job id, can be any string
name: Visual Studio 2019/2022 Build
strategy:
matrix:
include:
- os: windows-latest
generator: "Visual Studio 17 2022"
build_shared_libs: "ON"
platform: x64
- os: windows-latest
generator: "Visual Studio 17 2022"
build_shared_libs: "ON"
platform: x64
ci_mode: no-rtti
- os: windows-latest
generator: "Visual Studio 17 2022"
build_shared_libs: "ON"
platform: x64
ci_mode: no-exceptions
- os: windows-latest
generator: "Visual Studio 17 2022"
build_shared_libs: "OFF"
platform: x64
- os: windows-2019
generator: "Visual Studio 16 2019"
build_shared_libs: "ON"
platform: x64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate cache key
shell: bash
run: git submodule > '.github/.cache-key'
- name: Cache packages
uses: actions/cache@v3
with:
path: |
third_party/install
key: ${{ runner.os }}-${{ matrix.ci_mode }}-shared-${{ matrix.build_shared_libs }}-${ hashFiles('.github/.cache-key') }
- name: Build & Test
shell: pwsh
env:
CMAKE_GENERATOR: ${{ matrix.generator }}
CMAKE_PLATFORM: ${{ matrix.platform }}
BUILD_SHARED_LIBS: ${{ matrix.build_shared_libs }}
CONFIGURATION: RelWithDebInfo
CI_MODE: ${{ matrix.ci_mode }}
run: |
if ($ENV:CI_MODE -eq "no-rtti") {
pwsh ci/do_ci.ps1 msvc.no-rtti.test ;
} elseif($ENV:CI_MODE -eq "no-exceptions") {
pwsh ci/do_ci.ps1 msvc.no-exceptions.test ;
} else {
pwsh ci/do_ci.ps1 "msvc.2019+.test" ;
}
coverage: # job id, can be any string
name: Coverage
# This job runs on Linux
strategy:
matrix:
include:
- os: ubuntu-latest
triplet: x64-linux
cc: gcc
gcov_flags: "--coverage -fprofile-arcs -ftest-coverage"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate cache key
shell: bash
run: git submodule > '.github/.cache-key'
- name: Cache packages
uses: actions/cache@v3
with:
path: |
/usr/local/share/vcpkg/installed
third_party/install
key: ${{ runner.os }}-coverage-${ hashFiles('.github/.cache-key') }) }}
- name: Generate coverage
shell: bash
env:
USE_CC: ${{ matrix.cc }}
VCPKG_TARGET_TRIPLET: ${{ matrix.triplet }}
USE_SSL: ${{ matrix.ssl }}
GCOV_FLAGS: "${{ matrix.gcov_flags }}"
run: |
SETUP_INSTALL_LCOV=0
which lcov || SETUP_INSTALL_LCOV=1
set -e
if [[ $SETUP_INSTALL_LCOV -ne 0 ]]; then
sudo apt update -y
sudo apt install --no-install-recommends --no-install-suggests -y lcov
fi
bash ci/do_ci.sh coverage ;
- name: Uploaded code coverage
uses: codecov/codecov-action@v3
with:
token: ${{secrets.CODECOV_TOKEN}} # not required for public repos
fail_ci_if_error: true
file: ${{ github.workspace }}/build_jobs_coverage/coverage.info
codeql:
name: CodeQL
# This job runs on Linux
strategy:
fail-fast: false
matrix:
include:
- cc: gcc
triplet: x64-linux
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate cache key
shell: bash
run: git submodule > '.github/.cache-key'
- name: Cache packages
uses: actions/cache@v3
with:
path: |
third_party/install
key: ${{ runner.os }}-codeql-${ hashFiles('.github/.cache-key') }) }}
- name: Build
shell: bash
env:
USE_CC: ${{ matrix.cc }}
USE_SSL: ${{ matrix.ssl }}
VCPKG_TARGET_TRIPLET: ${{ matrix.triplet }}
run: |
bash ci/do_ci.sh codeql.configure
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
config-file: ./.github/codeql/codeql-config.yml
- name: Build
shell: bash
env:
USE_CC: ${{ matrix.cc }}
USE_SSL: ${{ matrix.ssl }}
VCPKG_TARGET_TRIPLET: ${{ matrix.triplet }}
run: |
bash ci/do_ci.sh codeql.build
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:cpp"