Skip to content

Commit dc5fc0e

Browse files
committed
Add libc++ github actionns workflow to replace buildkite.
This adds a github actions replacement for most of the buildkite pipeline. There are a lot of benefits to using actions over buildkite, so I'll spare the reader reciting them all. The primary reasons are: * More flexability * Easier for other contributors to maintain. * Easier to scale
1 parent 9365ed1 commit dc5fc0e

File tree

2 files changed

+180
-278
lines changed

2 files changed

+180
-278
lines changed
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
# This file defines pre-commit CI for libc++ [bla bla bla].
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+
# Job breakdown:
45+
# The jobs run in three stages to save resources while providing actionalable feedback as soon as possible.
46+
# The stages are broken down as follows:
47+
# - stage1:
48+
# Stage1 contains the bots that most often fail.
49+
jobs:
50+
stage1:
51+
runs-on: libcxx-runners-16
52+
continue-on-error: false
53+
strategy:
54+
fail-fast: true
55+
matrix:
56+
config: [ 'generic-cxx26', 'generic-cxx03', 'generic-modules' ]
57+
cc: [ clang-18 ]
58+
cxx: [ clang++-18 ]
59+
clang_tidy: [ 'ON' ]
60+
include:
61+
- config: 'generic-gcc'
62+
cc: 'gcc-13'
63+
cxx: 'g++-13'
64+
clang_tidy: 'OFF'
65+
steps:
66+
- uses: actions/checkout@v4
67+
- name: ${{ matrix.config }}.${{ matrix.cxx }}
68+
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
69+
env:
70+
CC: ${{ matrix.cc }}
71+
CXX: ${{ matrix.cxx }}
72+
ENABLE_CLANG_TIDY: ${{ matrix.clang_tidy }}
73+
- uses: actions/upload-artifact@v3
74+
if: always()
75+
with:
76+
name: ${{ matrix.config }}-${{ matrix.cxx }}-results
77+
path: |
78+
**/test-results.xml
79+
**/*.abilist
80+
**/CMakeError.log
81+
**/CMakeOutput.log
82+
**/crash_diagnostics/*
83+
stage2:
84+
runs-on: libcxx-runners-8
85+
needs: [ stage1 ]
86+
continue-on-error: false
87+
strategy:
88+
fail-fast: true
89+
matrix:
90+
config: [ 'generic-cxx11', 'generic-cxx14', 'generic-cxx17',
91+
'generic-cxx20', 'generic-cxx23' ]
92+
cc: [ 'clang-18' ]
93+
cxx: [ 'clang++-18' ]
94+
clang_tidy: [ 'ON' ]
95+
include:
96+
- config: 'generic-gcc-cxx11'
97+
cc: 'gcc-13'
98+
cxx: 'g++-13'
99+
clang_tidy: 'OFF'
100+
- config: 'generic-cxx23'
101+
cc: 'clang-16'
102+
cxx: 'clang++-16'
103+
clang_tidy: 'OFF'
104+
- config: 'generic-cxx23'
105+
cc: 'clang-17'
106+
cxx: 'clang++-17'
107+
clang_tidy: 'OFF'
108+
steps:
109+
- uses: actions/checkout@v4
110+
- name: ${{ matrix.config }}
111+
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
112+
env:
113+
CC: ${{ matrix.cc }}
114+
CXX: ${{ matrix.cxx }}
115+
ENABLE_CLANG_TIDY: ${{ matrix.clang_tidy }}
116+
- uses: actions/upload-artifact@v3
117+
if: always() # Upload artifacts even if the build or test suite fails
118+
with:
119+
name: ${{ matrix.config }}-results
120+
path: |
121+
**/test-results.xml
122+
**/*.abilist
123+
**/CMakeError.log
124+
**/CMakeOutput.log
125+
**/crash_diagnostics/*
126+
stage3:
127+
needs: [ stage1, stage2 ]
128+
continue-on-error: false
129+
strategy:
130+
fail-fast: false
131+
max-parallel: 8
132+
matrix:
133+
config: [ 'generic-no-threads', 'generic-no-filesystem', 'generic-no-random_device',
134+
'generic-no-localization', 'generic-no-unicode', 'generic-no-wide-characters',
135+
'generic-no-experimental', 'generic-no-exceptions', 'generic-abi-unstable',
136+
'generic-hardening-mode-fast',
137+
'generic-hardening-mode-fast-with-abi-breaks',
138+
'generic-hardening-mode-extensive',
139+
'generic-hardening-mode-debug', 'generic-with_llvm_unwinder', 'generic-static', 'generic-merged',
140+
'generic-modules-lsv', 'generic-no-tzdb' ]
141+
machine: [ 'libcxx-runners-8' ]
142+
std_modules: [ 'OFF' ]
143+
include:
144+
- config: 'generic-cxx26'
145+
machine: libcxx-runners-8
146+
std_modules: 'ON'
147+
- config: 'generic-asan'
148+
machine: libcxx-runners-16
149+
std_modules: 'OFF'
150+
- config: 'generic-tsan'
151+
machine: libcxx-runners-16
152+
std_modules: 'OFF'
153+
- config: 'generic-ubsan'
154+
machine: libcxx-runners-8
155+
std_modules: 'OFF'
156+
# Use a larger machine for MSAN to avoid timeout and memory allocation issues.
157+
- config: 'generic-msan'
158+
machine: libcxx-runners-30
159+
std_modules: 'OFF'
160+
runs-on: ${{ matrix.machine }}
161+
steps:
162+
- uses: actions/checkout@v4
163+
- name: ${{ matrix.config }}
164+
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
165+
env:
166+
CC: clang-18
167+
CXX: clang++-18
168+
ENABLE_CLANG_TIDY: "OFF"
169+
ENABLE_STD_MODULES: ${{ matrix.std_modules }}
170+
- uses: actions/upload-artifact@v3
171+
if: always()
172+
with:
173+
name: ${{ matrix.config }}-results
174+
path: |
175+
**/test-results.xml
176+
**/*.abilist
177+
**/CMakeError.log
178+
**/CMakeOutput.log
179+
**/crash_diagnostics/*
180+

0 commit comments

Comments
 (0)