-
Notifications
You must be signed in to change notification settings - Fork 12
176 lines (174 loc) · 5.21 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
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@v3
- 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
cc: gcc
- os: ubuntu-20.04
cc: gcc-4.8
- os: ubuntu-latest
cc: clang-latest
- os: macos-latest
cc: clang-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- 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: ${{ matrix.os }}-${{ matrix.cc }}-${{ hashFiles('.github/.cache-key') }}
- name: Build & Test
shell: bash
env:
USE_CC: ${{ matrix.cc }}
run: |
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$USE_CC" =~ xclang.* ]]; then
bash ci/do_ci.sh clang.test ;
else
bash ci/do_ci.sh gcc.test ;
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: "OFF"
platform: x64
- os: windows-2019
generator: "Visual Studio 16 2019"
build_shared_libs: "OFF"
platform: x64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- 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: ${{ matrix.os }}-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
run: |
pwsh ci/do_ci.ps1 "msvc.2019+.test" ;
mingw_build: # job id, can be any string
name: MinGW Build
strategy:
matrix:
include:
- os: windows-latest
build_shared_libs: "ON"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Generate cache key
shell: bash
run: git submodule > '.github/.cache-key'
- name: Cache packages
uses: actions/cache@v3
with:
path: |
third_party/install
C:/msys64/var/cache/pacman/pkg
key: ${{ matrix.os }}-mingw-${{ hashFiles('.github/.cache-key') }}
- name: Build & Test
shell: bash
env:
BUILD_SHARED_LIBS: ${{ matrix.build_shared_libs }}
run: |
C:/msys64/msys2_shell.cmd -mingw64 -defterm -no-start -here -lc "ci/do_ci.sh msys2.mingw.test"
codeql:
name: CodeQL
# This job runs on Linux
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
cc: gcc
runs-on: ${{ matrix.os }}
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout
uses: actions/checkout@v3
- 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: ${{ matrix.os }}-codeql-${{ matrix.cc }}-${{ hashFiles('.github/.cache-key') }}
- name: Configure
shell: bash
env:
USE_CC: ${{ matrix.cc }}
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 }}
run: |
bash ci/do_ci.sh codeql.build
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:cpp"