Skip to content

Commit 484a281

Browse files
[CI][Github] Add linux premerge workflow (#119635)
This patch adds a Github Actions workflow for Linux premerge. This currently just calls into the existing CI scripts as a starting point.
1 parent 51a0919 commit 484a281

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

.github/workflows/premerge.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: LLVM Premerge Checks
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
paths:
9+
- .github/workflows/premerge.yaml
10+
11+
jobs:
12+
premerge-checks-linux:
13+
if: github.repository_owner == 'llvm'
14+
runs-on: llvm-premerge-linux-runners
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
17+
cancel-in-progress: true
18+
container:
19+
image: ghcr.io/llvm/ci-ubuntu-22.04:latest
20+
defaults:
21+
run:
22+
shell: bash
23+
steps:
24+
- name: Checkout LLVM
25+
uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 2
28+
- name: Setup ccache
29+
uses: hendrikmuhs/[email protected]
30+
- name: Build and Test
31+
run: |
32+
git config --global --add safe.directory '*'
33+
34+
modified_files=$(git diff --name-only HEAD~1...HEAD)
35+
modified_dirs=$(echo "$modified_files" | cut -d'/' -f1 | sort -u)
36+
37+
echo $modified_files
38+
echo $modified_dirs
39+
40+
. ./.ci/compute-projects.sh
41+
42+
all_projects="bolt clang clang-tools-extra compiler-rt cross-project-tests flang libc libclc lld lldb llvm mlir openmp polly pstl"
43+
modified_projects="$(keep-modified-projects ${all_projects})"
44+
45+
linux_projects_to_test=$(exclude-linux $(compute-projects-to-test 0 ${modified_projects}))
46+
linux_check_targets=$(check-targets ${linux_projects_to_test} | sort | uniq)
47+
linux_projects=$(add-dependencies ${linux_projects_to_test} | sort | uniq)
48+
49+
linux_runtimes_to_test=$(compute-runtimes-to-test ${linux_projects_to_test})
50+
linux_runtime_check_targets=$(check-targets ${linux_runtimes_to_test} | sort | uniq)
51+
linux_runtimes=$(echo ${linux_runtimes_to_test} | sort | uniq)
52+
53+
if [[ "${linux_projects}" == "" ]]; then
54+
echo "No projects to build"
55+
exit 0
56+
fi
57+
58+
echo "Building projects: ${linux_projects}"
59+
echo "Running project checks targets: ${linux_check_targets}"
60+
echo "Building runtimes: ${linux_runtimes}"
61+
echo "Running runtimes checks targets: ${linux_runtime_check_targets}"
62+
63+
export CC=/opt/llvm/bin/clang
64+
export CXX=/opt/llvm/bin/clang++
65+
66+
./.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})" "$(echo ${linux_runtimes} | tr ' ' ';')" "$(echo ${linux_runtime_check_targets})"

0 commit comments

Comments
 (0)