-
Notifications
You must be signed in to change notification settings - Fork 13.3k
178 lines (160 loc) · 6.66 KB
/
premerge.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
name: LLVM Premerge Checks
permissions:
contents: read
on:
pull_request:
types:
- opened
- synchronize
- reopened
# When a PR is closed, we still start this workflow, but then skip
# all the jobs, which makes it effectively a no-op. The reason to
# do this is that it allows us to take advantage of concurrency groups
# to cancel in progress CI jobs whenever the PR is closed.
- closed
push:
branches:
- 'main'
- 'release/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
premerge-checks-linux:
name: Linux Premerge Checks (Test Only - Please Ignore Results)
if: >-
github.repository_owner == 'llvm' &&
(github.event_name != 'pull_request' || github.event.action != 'closed')
runs-on: llvm-premerge-linux-runners
steps:
- name: Checkout LLVM
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 2
- name: Setup ccache
uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17
with:
max-size: "2000M"
- name: Build and Test
# Mark the job as a success even if the step fails so that people do
# not get notified while the new premerge pipeline is in an
# experimental state.
# TODO(boomanaiden154): Remove this once the pipeline is stable and we
# are ready for people to start recieving notifications.
continue-on-error: true
run: |
git config --global --add safe.directory '*'
source <(git diff --name-only HEAD~1...HEAD | python3 .ci/compute_projects.py)
if [[ "${projects_to_build}" == "" ]]; then
echo "No projects to build"
exit 0
fi
echo "Building projects: ${projects_to_build}"
echo "Running project checks targets: ${project_check_targets}"
echo "Building runtimes: ${runtimes_to_build}"
echo "Running runtimes checks targets: ${runtimes_check_targets}"
export CC=/opt/llvm/bin/clang
export CXX=/opt/llvm/bin/clang++
./.ci/monolithic-linux.sh "${projects_to_build}" "${project_check_targets}" "${runtimes_to_build}" "${runtimes_check_targets}"
- name: "Upload artifact"
- name: Upload Artifacts
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: Premerge Artifacts (Linux)
path: artifacts/
retention-days: 5
include-hidden-files: 'true'
premerge-checks-windows:
name: Windows Premerge Checks (Test Only - Please Ignore Results)
if: >-
github.repository_owner == 'llvm' &&
(github.event_name != 'pull_request' || github.event.action != 'closed')
runs-on: llvm-premerge-windows-runners
defaults:
run:
shell: bash
steps:
- name: Checkout LLVM
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 2
- name: Setup ccache
uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17
with:
variant: "sccache"
max-size: "2000M"
- name: Compute Projects
id: vars
run: |
source <(git diff --name-only HEAD~1...HEAD | python .ci/compute_projects.py)
if [[ "${projects_to_build}" == "" ]]; then
echo "No projects to build"
fi
echo "Building projects: ${projects_to_build}"
echo "Running project checks targets: ${project_check_targets}"
echo "windows-projects=${projects_to_build}" >> $GITHUB_OUTPUT
echo "windows-check-targets=${project_check_targets}" >> $GITHUB_OUTPUT
- name: Build and Test
# Mark the job as a success even if the step fails so that people do
# not get notified while the new premerge pipeline is in an
# experimental state.
# TODO(boomanaiden154): Remove this once the pipeline is stable and we
# are ready for people to start recieving notifications.
continue-on-error: true
if: ${{ steps.vars.outputs.windows-projects != '' }}
shell: cmd
run: |
set MAX_PARALLEL_COMPILE_JOBS=64
set MAX_PARALLEL_LINK_JOBS=64
call C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat -arch=amd64 -host_arch=amd64
bash .ci/monolithic-windows.sh "${{ steps.vars.outputs.windows-projects }}" "${{ steps.vars.outputs.windows-check-targets }}"
- name: Upload Artifacts
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: Premerge Artifacts (Windows)
path: artifacts/
retention-days: 5
include-hidden-files: 'true'
premerge-check-macos:
name: MacOS Premerge Checks
runs-on: macos-14
if: >-
github.repository_owner == 'llvm' &&
(startswith(github.ref_name, 'release/') ||
startswith(github.base_ref, 'release/')) &&
(github.event_name != 'pull_request' || github.event.action != 'closed')
steps:
- name: Checkout LLVM
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 2
- name: Setup ccache
uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17
with:
max-size: "2000M"
- name: Install Ninja
uses: llvm/actions/install-ninja@main
- name: Build and Test
run: |
source <(git diff --name-only HEAD~2..HEAD | python3 .ci/compute_projects.py)
if [[ "${projects_to_build}" == "" ]]; then
echo "No projects to build"
exit 0
fi
echo "Building projects: ${projects_to_build}"
echo "Running project checks targets: ${project_check_targets}"
# -DLLVM_DISABLE_ASSEMBLY_FILES=ON is for
# https://github.com/llvm/llvm-project/issues/81967
# Disable sharding in lit so that the LIT_XFAIL environment var works.
cmake -G Ninja \
-B build \
-S llvm \
-DLLVM_ENABLE_PROJECTS="${projects_to_build}" \
-DLLVM_DISABLE_ASSEMBLY_FILES=ON \
-DCMAKE_BUILD_TYPE=Release \
-DLLDB_INCLUDE_TESTS=OFF \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
# The libcxx tests fail, so we are skipping the runtime targets.
ninja -C build ${project_check_targets}