Skip to content

Commit 6c87449

Browse files
EricWFzahiraam
authored andcommitted
Add libc++ github actions workflow to replace buildkite (llvm#71836)
This change ports almost all of the linux buildkite builders to github actions. I would like to have this transition occur as soon as possible.
1 parent 0488b59 commit 6c87449

File tree

2 files changed

+196
-278
lines changed

2 files changed

+196
-278
lines changed
Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
# This file defines pre-commit CI for libc++, libc++abi, and libunwind (on Github).
2+
#
3+
# We split the configurations in multiple stages with the intent of saving compute time
4+
# when a job fails early in the pipeline. This is why the jobs are marked as `continue-on-error: false`.
5+
# We try to run the CI configurations with the most signal in the first stage.
6+
#
7+
# Stages 1 & 2 are meant to be "smoke tests", and are meant to catch most build/test failures quickly and without using
8+
# too many resources.
9+
# Stage 3 is "everything else", and is meant to catch breakages on more niche or unique configurations.
10+
#
11+
# Therefore, we "fail-fast" for any failures during stages 1 & 2, meaning any job failing cancels all other running jobs,
12+
# under the assumption that if the "smoke tests" fail, then the other configurations will likely fail in the same way.
13+
# However, stage 3 does not fail fast, as it's more likely that any one job failing is a flake or a configuration-specific
14+
#
15+
name: Build and Test libc++
16+
on:
17+
pull_request:
18+
paths:
19+
- 'libcxx/**'
20+
- 'libcxxabi/**'
21+
- 'libunwind/**'
22+
- 'runtimes/**'
23+
- 'cmake/**'
24+
- '.github/workflows/libcxx-build-and-test.yaml'
25+
26+
concurrency:
27+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
28+
cancel-in-progress: true
29+
30+
31+
env:
32+
CMAKE: "/opt/bin/cmake"
33+
# LLVM POST-BRANCH bump version
34+
# LLVM POST-BRANCH add compiler test for ToT - 1, e.g. "Clang 17"
35+
# LLVM RELEASE bump remove compiler ToT - 3, e.g. "Clang 15"
36+
LLVM_HEAD_VERSION: "18" # Used compiler, update POST-BRANCH.
37+
LLVM_PREVIOUS_VERSION: "17"
38+
LLVM_OLDEST_VERSION: "16"
39+
GCC_STABLE_VERSION: "13"
40+
LLVM_SYMBOLIZER_PATH: "/usr/bin/llvm-symbolizer-18"
41+
CLANG_CRASH_DIAGNOSTICS_DIR: "crash_diagnostics"
42+
43+
44+
jobs:
45+
stage1:
46+
runs-on: libcxx-runners-16
47+
continue-on-error: false
48+
strategy:
49+
fail-fast: true
50+
matrix:
51+
config: [
52+
'generic-cxx03',
53+
'generic-cxx26',
54+
'generic-modules'
55+
]
56+
cc: [ 'clang-18' ]
57+
cxx: [ 'clang++-18' ]
58+
clang_tidy: [ 'ON' ]
59+
include:
60+
- config: 'generic-gcc'
61+
cc: 'gcc-13'
62+
cxx: 'g++-13'
63+
clang_tidy: 'OFF'
64+
steps:
65+
- uses: actions/checkout@v4
66+
- name: ${{ matrix.config }}.${{ matrix.cxx }}
67+
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
68+
env:
69+
CC: ${{ matrix.cc }}
70+
CXX: ${{ matrix.cxx }}
71+
ENABLE_CLANG_TIDY: ${{ matrix.clang_tidy }}
72+
- uses: actions/upload-artifact@v3
73+
if: always()
74+
with:
75+
name: ${{ matrix.config }}-${{ matrix.cxx }}-results
76+
path: |
77+
**/test-results.xml
78+
**/*.abilist
79+
**/CMakeError.log
80+
**/CMakeOutput.log
81+
**/crash_diagnostics/*
82+
stage2:
83+
runs-on: libcxx-runners-8
84+
needs: [ stage1 ]
85+
continue-on-error: false
86+
strategy:
87+
fail-fast: true
88+
matrix:
89+
config: [
90+
'generic-cxx11',
91+
'generic-cxx14',
92+
'generic-cxx17',
93+
'generic-cxx20',
94+
'generic-cxx23'
95+
]
96+
cc: [ 'clang-18' ]
97+
cxx: [ 'clang++-18' ]
98+
clang_tidy: [ 'ON' ]
99+
include:
100+
- config: 'generic-gcc-cxx11'
101+
cc: 'gcc-13'
102+
cxx: 'g++-13'
103+
clang_tidy: 'OFF'
104+
- config: 'generic-cxx23'
105+
cc: 'clang-16'
106+
cxx: 'clang++-16'
107+
clang_tidy: 'OFF'
108+
- config: 'generic-cxx23'
109+
cc: 'clang-17'
110+
cxx: 'clang++-17'
111+
clang_tidy: 'OFF'
112+
steps:
113+
- uses: actions/checkout@v4
114+
- name: ${{ matrix.config }}
115+
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
116+
env:
117+
CC: ${{ matrix.cc }}
118+
CXX: ${{ matrix.cxx }}
119+
ENABLE_CLANG_TIDY: ${{ matrix.clang_tidy }}
120+
- uses: actions/upload-artifact@v3
121+
if: always() # Upload artifacts even if the build or test suite fails
122+
with:
123+
name: ${{ matrix.config }}-results
124+
path: |
125+
**/test-results.xml
126+
**/*.abilist
127+
**/CMakeError.log
128+
**/CMakeOutput.log
129+
**/crash_diagnostics/*
130+
stage3:
131+
needs: [ stage1, stage2 ]
132+
continue-on-error: false
133+
strategy:
134+
fail-fast: false
135+
max-parallel: 8
136+
matrix:
137+
config: [
138+
'generic-abi-unstable',
139+
'generic-hardening-mode-debug',
140+
'generic-hardening-mode-extensive',
141+
'generic-hardening-mode-fast',
142+
'generic-hardening-mode-fast-with-abi-breaks',
143+
'generic-merged',
144+
'generic-modules-lsv',
145+
'generic-no-exceptions',
146+
'generic-no-experimental',
147+
'generic-no-filesystem',
148+
'generic-no-localization',
149+
'generic-no-random_device',
150+
'generic-no-threads',
151+
'generic-no-tzdb',
152+
'generic-no-unicode',
153+
'generic-no-wide-characters',
154+
'generic-static',
155+
'generic-with_llvm_unwinder'
156+
]
157+
machine: [ 'libcxx-runners-8' ]
158+
std_modules: [ 'OFF' ]
159+
include:
160+
- config: 'generic-cxx26'
161+
machine: libcxx-runners-8
162+
std_modules: 'ON'
163+
- config: 'generic-asan'
164+
machine: libcxx-runners-16
165+
std_modules: 'OFF'
166+
- config: 'generic-tsan'
167+
machine: libcxx-runners-16
168+
std_modules: 'OFF'
169+
- config: 'generic-ubsan'
170+
machine: libcxx-runners-8
171+
std_modules: 'OFF'
172+
# Use a larger machine for MSAN to avoid timeout and memory allocation issues.
173+
- config: 'generic-msan'
174+
machine: libcxx-runners-30
175+
std_modules: 'OFF'
176+
runs-on: ${{ matrix.machine }}
177+
steps:
178+
- uses: actions/checkout@v4
179+
- name: ${{ matrix.config }}
180+
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
181+
env:
182+
CC: clang-18
183+
CXX: clang++-18
184+
ENABLE_CLANG_TIDY: "OFF"
185+
ENABLE_STD_MODULES: ${{ matrix.std_modules }}
186+
- uses: actions/upload-artifact@v3
187+
if: always()
188+
with:
189+
name: ${{ matrix.config }}-results
190+
path: |
191+
**/test-results.xml
192+
**/*.abilist
193+
**/CMakeError.log
194+
**/CMakeOutput.log
195+
**/crash_diagnostics/*
196+

0 commit comments

Comments
 (0)