Skip to content

Commit 26341a9

Browse files
committed
[rust] Add CI Checks to Rust fork
- On Linux, run `check-llvm` and `check-lld`. - On macOS, run `check-llvm`.
1 parent d3c793b commit 26341a9

File tree

1 file changed

+104
-0
lines changed

1 file changed

+104
-0
lines changed

.github/workflows/rust-premerge.yaml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: CI Checks (Rust fork)
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
types:
9+
- opened
10+
- synchronize
11+
- reopened
12+
# When a PR is closed, we still start this workflow, but then skip
13+
# all the jobs, which makes it effectively a no-op. The reason to
14+
# do this is that it allows us to take advantage of concurrency groups
15+
# to cancel in progress CI jobs whenever the PR is closed.
16+
- closed
17+
push:
18+
branches:
19+
- 'rustc/**'
20+
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
23+
cancel-in-progress: true
24+
25+
jobs:
26+
premerge-checks-linux:
27+
name: Build and Test Linux
28+
if: >-
29+
github.repository_owner == 'dianqk' &&
30+
(github.event_name != 'pull_request' || github.event.action != 'closed')
31+
runs-on: ubuntu-24.04
32+
steps:
33+
- name: Checkout LLVM
34+
uses: actions/[email protected]
35+
with:
36+
fetch-depth: 1
37+
- name: Free Disk Space (Ubuntu)
38+
uses: jlumbroso/[email protected]
39+
- name: Install clang-18
40+
run: |
41+
sudo apt-get update
42+
sudo apt-get install -y clang-18
43+
- name: Setup ccache
44+
uses: hendrikmuhs/[email protected]
45+
with:
46+
max-size: "2000M"
47+
- name: Build and Test
48+
run: |
49+
projects_to_build='llvm;lld'
50+
project_check_targets='check-llvm check-lld'
51+
runtimes_to_build=''
52+
runtimes_check_targets=''
53+
runtimes_check_targets_needs_reconfig=''
54+
55+
echo "Building projects: ${projects_to_build}"
56+
echo "Running project checks targets: ${project_check_targets}"
57+
echo "Building runtimes: ${runtimes_to_build}"
58+
echo "Running runtimes checks targets: ${runtimes_check_targets}"
59+
echo "Running runtimes checks requiring reconfiguring targets: ${runtimes_check_targets_needs_reconfig}"
60+
61+
export CC=/usr/bin/clang-18
62+
export CXX=/usr/bin/clang++-18
63+
64+
./.ci/monolithic-linux.sh "${projects_to_build}" "${project_check_targets}" "${runtimes_to_build}" "${runtimes_check_targets}" "${runtimes_check_targets_needs_reconfig}"
65+
66+
premerge-check-macos:
67+
name: Build and Test macOS
68+
runs-on: macos-14
69+
if: >-
70+
github.repository_owner == 'dianqk' &&
71+
(github.event_name != 'pull_request' || github.event.action != 'closed')
72+
steps:
73+
- name: Checkout LLVM
74+
uses: actions/[email protected]
75+
with:
76+
fetch-depth: 1
77+
- name: Setup ccache
78+
uses: hendrikmuhs/[email protected]
79+
with:
80+
max-size: "2000M"
81+
- name: Build and Test
82+
run: |
83+
projects_to_build='llvm'
84+
project_check_targets='check-llvm'
85+
86+
echo "Building projects: ${projects_to_build}"
87+
echo "Running project checks targets: ${project_check_targets}"
88+
89+
# -DLLVM_DISABLE_ASSEMBLY_FILES=ON is for
90+
# https://github.com/llvm/llvm-project/issues/81967
91+
# Disable sharding in lit so that the LIT_XFAIL environment var works.
92+
cmake -G Ninja \
93+
-B build \
94+
-S llvm \
95+
-DLLVM_ENABLE_PROJECTS="${projects_to_build}" \
96+
-DLLVM_DISABLE_ASSEMBLY_FILES=ON \
97+
-DCMAKE_BUILD_TYPE=Release \
98+
-DLLDB_INCLUDE_TESTS=OFF \
99+
-DLLVM_ENABLE_ASSERTIONS=ON \
100+
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
101+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
102+
103+
# The libcxx tests fail, so we are skipping the runtime targets.
104+
ninja -C build ${project_check_targets}

0 commit comments

Comments
 (0)