-
Notifications
You must be signed in to change notification settings - Fork 12k
289 lines (281 loc) · 9.77 KB
/
libcxx-build-and-test.yaml
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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
# This file defines pre-commit CI for libc++, libc++abi, and libunwind (on Github).
#
# We split the configurations in multiple stages with the intent of saving compute time
# when a job fails early in the pipeline. This is why the jobs are marked as `continue-on-error: false`.
# We try to run the CI configurations with the most signal in the first stage.
#
# Stages 1 & 2 are meant to be "smoke tests", and are meant to catch most build/test failures quickly and without using
# too many resources.
# Stage 3 is "everything else", and is meant to catch breakages on more niche or unique configurations.
#
# Therefore, we "fail-fast" for any failures during stages 1 & 2, meaning any job failing cancels all other running jobs,
# under the assumption that if the "smoke tests" fail, then the other configurations will likely fail in the same way.
# However, stage 3 does not fail fast, as it's more likely that any one job failing is a flake or a configuration-specific
#
name: Build and Test libc++
on:
pull_request:
paths:
- 'libcxx/**'
- 'libcxxabi/**'
- 'libunwind/**'
- 'runtimes/**'
- 'cmake/**'
- '.github/workflows/libcxx-build-and-test.yaml'
schedule:
# Run nightly at 08:00 UTC (aka 00:00 Pacific, aka 03:00 Eastern)
- cron: '0 8 * * *'
permissions:
contents: read # Default everything to read-only
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
env:
# LLVM POST-BRANCH bump version
# LLVM POST-BRANCH add compiler test for ToT - 1, e.g. "Clang 17"
# LLVM RELEASE bump remove compiler ToT - 3, e.g. "Clang 15"
LLVM_HEAD_VERSION: "19" # Used compiler, update POST-BRANCH.
LLVM_PREVIOUS_VERSION: "18"
LLVM_OLDEST_VERSION: "17"
GCC_STABLE_VERSION: "13"
LLVM_SYMBOLIZER_PATH: "/usr/bin/llvm-symbolizer-19"
CLANG_CRASH_DIAGNOSTICS_DIR: "crash_diagnostics"
jobs:
stage1:
if: github.repository_owner == 'llvm'
runs-on: libcxx-runners-set
container: ghcr.io/libcxx/actions-builder:testing-2024-09-21
continue-on-error: false
strategy:
fail-fast: false
matrix:
config: [
'generic-cxx03',
'generic-cxx26',
'generic-modules'
]
cc: [ 'clang-19' ]
cxx: [ 'clang++-19' ]
include:
- config: 'generic-gcc'
cc: 'gcc-14'
cxx: 'g++-14'
steps:
- uses: actions/checkout@v4
- name: ${{ matrix.config }}.${{ matrix.cxx }}
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
if: always()
with:
name: ${{ matrix.config }}-${{ matrix.cxx }}-results
path: |
**/test-results.xml
**/*.abilist
**/CMakeConfigureLog.yaml
**/CMakeError.log
**/CMakeOutput.log
**/crash_diagnostics/*
stage2:
if: github.repository_owner == 'llvm'
runs-on: libcxx-runners-set
container: ghcr.io/libcxx/actions-builder:testing-2024-09-21
needs: [ stage1 ]
continue-on-error: false
strategy:
fail-fast: false
matrix:
config: [
'generic-cxx11',
'generic-cxx14',
'generic-cxx17',
'generic-cxx20',
'generic-cxx23'
]
cc: [ 'clang-19' ]
cxx: [ 'clang++-19' ]
include:
- config: 'generic-gcc-cxx11'
cc: 'gcc-14'
cxx: 'g++-14'
- config: 'generic-cxx23'
cc: 'clang-17'
cxx: 'clang++-17'
- config: 'generic-cxx26'
cc: 'clang-18'
cxx: 'clang++-18'
steps:
- uses: actions/checkout@v4
- name: ${{ matrix.config }}
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
if: always() # Upload artifacts even if the build or test suite fails
with:
name: ${{ matrix.config }}-${{ matrix.cxx }}-results
path: |
**/test-results.xml
**/*.abilist
**/CMakeConfigureLog.yaml
**/CMakeError.log
**/CMakeOutput.log
**/crash_diagnostics/*
stage3:
if: github.repository_owner == 'llvm'
needs: [ stage1, stage2 ]
continue-on-error: false
strategy:
fail-fast: false
max-parallel: 8
matrix:
config: [
'generic-abi-unstable',
'generic-hardening-mode-debug',
'generic-hardening-mode-extensive',
'generic-hardening-mode-fast',
'generic-hardening-mode-fast-with-abi-breaks',
'generic-merged',
'generic-modules-lsv',
'generic-no-exceptions',
'generic-no-experimental',
'generic-no-filesystem',
'generic-no-localization',
'generic-no-terminal',
'generic-no-random_device',
'generic-no-threads',
'generic-no-tzdb',
'generic-no-unicode',
'generic-no-wide-characters',
'generic-no-rtti',
'generic-optimized-speed',
'generic-static',
'bootstrapping-build'
]
machine: [ 'libcxx-runners-set' ]
include:
- config: 'generic-cxx26'
machine: libcxx-runners-set
- config: 'generic-asan'
machine: libcxx-runners-set
- config: 'generic-tsan'
machine: libcxx-runners-set
- config: 'generic-ubsan'
machine: libcxx-runners-set
# Use a larger machine for MSAN to avoid timeout and memory allocation issues.
- config: 'generic-msan'
machine: libcxx-runners-set
runs-on: ${{ matrix.machine }}
container: ghcr.io/libcxx/actions-builder:testing-2024-09-21
steps:
- uses: actions/checkout@v4
- name: ${{ matrix.config }}
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
env:
CC: clang-19
CXX: clang++-19
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
if: always()
with:
name: ${{ matrix.config }}-results
path: |
**/test-results.xml
**/*.abilist
**/CMakeConfigureLog.yaml
**/CMakeError.log
**/CMakeOutput.log
**/crash_diagnostics/*
macos:
needs: [ stage1 ]
strategy:
fail-fast: false
matrix:
include:
- config: generic-cxx03
os: macos-15
- config: generic-cxx23
os: macos-15
- config: generic-modules
os: macos-15
- config: apple-configuration
os: macos-15
- config: apple-system
os: macos-13
- config: apple-system-hardened
os: macos-13
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 'latest'
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Build and test
run: |
python3 -m venv .venv
source .venv/bin/activate
python -m pip install psutil
bash libcxx/utils/ci/run-buildbot ${{ matrix.config }}
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
if: always() # Upload artifacts even if the build or test suite fails
with:
name: macos-${{ matrix.config }}-results
path: |
**/test-results.xml
**/*.abilist
**/CMakeConfigureLog.yaml
**/CMakeError.log
**/CMakeOutput.log
**/crash_diagnostics/*
windows:
runs-on: windows-2022
needs: [ stage1 ]
strategy:
fail-fast: false
matrix:
include:
- { config: clang-cl-dll, mingw: false }
- { config: clang-cl-static, mingw: false }
- { config: clang-cl-no-vcruntime, mingw: false }
- { config: clang-cl-debug, mingw: false }
- { config: clang-cl-static-crt, mingw: false }
- { config: mingw-dll, mingw: true }
- { config: mingw-static, mingw: true }
- { config: mingw-dll-i686, mingw: true }
- { config: mingw-incomplete-sysroot, mingw: true }
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
choco install -y ninja
pip install psutil
- name: Install a current LLVM
if: ${{ matrix.mingw != true }}
run: |
choco install -y llvm --version=18.1.6 --allow-downgrade
- name: Install llvm-mingw
if: ${{ matrix.mingw == true }}
run: |
curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20240606/llvm-mingw-20240606-ucrt-x86_64.zip
powershell Expand-Archive llvm-mingw*.zip -DestinationPath .
del llvm-mingw*.zip
mv llvm-mingw* c:\llvm-mingw
echo "c:\llvm-mingw\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
- name: Simulate a from-scratch build of llvm-mingw
if: ${{ matrix.config == 'mingw-incomplete-sysroot' }}
run: |
rm -r c:\llvm-mingw\include\c++
rm -r c:\llvm-mingw\*-w64-mingw32\lib\libc++*
rm -r c:\llvm-mingw\*-w64-mingw32\lib\libunwind*
- name: Add Git Bash to the path
run: |
echo "c:\Program Files\Git\usr\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
- name: Set up the MSVC dev environment
if: ${{ matrix.mingw != true }}
uses: ilammy/msvc-dev-cmd@v1
- name: Build and test
run: |
bash libcxx/utils/ci/run-buildbot ${{ matrix.config }}