-
Notifications
You must be signed in to change notification settings - Fork 3
189 lines (157 loc) · 5.64 KB
/
integrate.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
name: integration
on: [push, pull_request]
jobs:
Build:
name: ${{matrix.name}} (${{matrix.config}})
runs-on: ${{matrix.os}}
env:
CMAKE_GENERATOR: Ninja
strategy:
fail-fast: false
matrix:
name: [
ubuntu-18.04-gcc-9,
ubuntu-20.04-gcc-9,
ubuntu-20.04-gcc-10,
ubuntu-20.04-clang-8,
ubuntu-20.04-clang-9,
ubuntu-20.04-clang-10,
ubuntu-20.04-clang-11,
windows-2016-msvc2017,
windows-2019-msvc2019,
macos-10.15-xcode-11,
macos-10.15-xcode-11.4,
macos-10.15-xcode-12,
macos-11.0-x86_64,
macos-11.0-arm64
]
config: [Debug, Release]
include:
- name: ubuntu-18.04-gcc-9
os: ubuntu-18.04
compiler: gcc
version: "9"
- name: ubuntu-20.04-gcc-9
os: ubuntu-20.04
compiler: gcc
version: "9"
- name: ubuntu-20.04-gcc-10
os: ubuntu-20.04
compiler: gcc
version: "10"
- name: ubuntu-20.04-clang-8
os: ubuntu-20.04
compiler: clang
version: "8"
- name: ubuntu-20.04-clang-9
os: ubuntu-20.04
compiler: clang
version: "9"
- name: ubuntu-20.04-clang-10
os: ubuntu-20.04
compiler: clang
version: "10"
- name: ubuntu-20.04-clang-11
os: ubuntu-20.04
compiler: clang
version: "11"
- name: windows-2016-msvc2017
os: windows-2016
compiler: cl
version: "Visual Studio 15 2017 Win64"
- name: windows-2019-msvc2019
os: windows-2019
compiler: cl
version: "Visual Studio 16 2019"
- name: macOS-10.15-xcode-11
os: macOS-10.15
compiler: xcode
version: "11"
- name: macOS-10.15-xcode-11.4
os: macOS-10.15
compiler: xcode
version: "11.4"
- name: macOS-10.15-xcode-12
os: macOS-10.15
compiler: xcode
version: "12"
- name: macos-11.0-x86_64
os: macos-11.0
compiler: xcode
version: "12.2"
cmake: "-DCMAKE_OSX_ARCHITECTURES=x86_64"
- name: macos-11.0-arm64
os: macos-11.0
compiler: xcode
version: "12.2"
cmake: "-DCMAKE_OSX_ARCHITECTURES=arm64"
steps:
- uses: actions/checkout@v2
- name: Dependencies (Linux)
if: runner.os == 'Linux'
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
if [ "${{matrix.compiler}}" = "clang" ] && [ "${{matrix.version}}" = "11" ]; then
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main"
sudo apt-get update
fi
sudo apt-get install -y ninja-build
if [ "${{matrix.compiler}}" = "gcc" ]; then
sudo apt-get install -y g++-${{matrix.version}}
echo "CC=gcc-${{matrix.version}}" >> $GITHUB_ENV
echo "CXX=g++-${{matrix.version}}" >> $GITHUB_ENV
else
sudo apt-get install -y clang-${{matrix.version}}
echo "CC=clang-${{matrix.version}}" >> $GITHUB_ENV
echo "CXX=clang++-${{matrix.version}}" >> $GITHUB_ENV
fi
- name: Dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install ninja
if [ "${{matrix.compiler}}" = "gcc" ]; then
brew install gcc@${{matrix.version}}
echo "CC=gcc-${{matrix.version}}" >> $GITHUB_ENV
echo "CXX=g++-${{matrix.version}}" >> $GITHUB_ENV
fi
if [ "${{matrix.compiler}}" = "xcode" ]; then
ls -ls /Applications/
sudo xcode-select -switch /Applications/Xcode_${{matrix.version}}.app
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
fi
- name: Dependencies (Windows)
if: runner.os == 'Windows'
run: |
if ( "${{matrix.compiler}}" -eq "gcc" ) {
choco install gcc --global
echo "CC=gcc" >> $Env:GITHUB_ENV
echo "CXX=g++" >> $Env:GITHUB_ENV
}
elseif ( "${{matrix.compiler}}".StartsWith( "clang" ) ) {
choco install llvm --global
echo "CC=clang" >> $Env:GITHUB_ENV
echo "CXX=clang++" >> $Env:GITHUB_ENV
}
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: 'cpp'
- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake (Unix)
if: runner.os == 'macOS' || runner.os == 'Linux'
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{matrix.config}} ${{matrix.cmake}}
- name: Configure CMake (Windows)
if: runner.os == 'Windows'
working-directory: ${{runner.workspace}}/build
run: cmake $Env:GITHUB_WORKSPACE -G"${{matrix.version}}" -DCMAKE_BUILD_TYPE=${{matrix.config}}
- name: Build
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config ${{matrix.config}}
- name: Test
working-directory: ${{runner.workspace}}/build
run: ctest -C ${{matrix.config}}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1