Skip to content

Commit 1dfa287

Browse files
committed
workflows/premerge: Add macOS testing for release branch
1 parent 7842374 commit 1dfa287

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

.github/workflows/premerge.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
push:
1111
branches:
1212
- 'main'
13+
- 'release/**'
1314

1415
jobs:
1516
premerge-checks-linux:
@@ -70,3 +71,70 @@ jobs:
7071
export CXX=/opt/llvm/bin/clang++
7172
7273
./.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})" "$(echo ${linux_runtimes} | tr ' ' ';')" "$(echo ${linux_runtime_check_targets})"
74+
75+
76+
permerge-check-macos:
77+
runs-on: macos-14
78+
if: >-
79+
github.repository_owner == 'llvm' &&
80+
(startswith(github.ref_name, 'release/') ||
81+
startswith(github.base_ref, 'refs/heads/release/')
82+
steps:
83+
- name: Checkout LLVM
84+
uses: actions/checkout@v4
85+
with:
86+
fetch-depth: 2
87+
- name: Setup ccache
88+
uses: hendrikmuhs/[email protected]
89+
with:
90+
max-size: "2000M"
91+
- name: Install Ninja
92+
uses: llvm/actions/install-ninja@main
93+
- name: Build and Test
94+
run: |
95+
git config --global --add safe.directory '*'
96+
97+
modified_files=$(git diff --name-only HEAD~1...HEAD)
98+
modified_dirs=$(echo "$modified_files" | cut -d'/' -f1 | sort -u)
99+
100+
echo $modified_files
101+
echo $modified_dirs
102+
103+
. ./.ci/compute-projects.sh
104+
105+
all_projects="clang clang-tools-extra lld lldb llvm mlir"
106+
modified_projects="$(keep-modified-projects ${all_projects})"
107+
108+
mac_check_targets=$(check-targets ${modified_projects} | sort | uniq | tr '\n' ' ')
109+
mac_projects=$(add-dependencies ${modified_projects} | sort | uniq | tr '\n' ' ')
110+
111+
mac_runtimes_to_test=$(compute-runtimes-to-test ${modified_projects})
112+
mac_runtime_check_targets=$(check-targets ${mac_runtimes_to_test} | sort | uniq | tr '\n' ' ')
113+
mac_runtimes=$(echo ${mac_runtimes_to_test} | tr ' ' '\n' | sort | uniq | tr '\n' ' ')
114+
115+
if [[ "${mac_projects}" == "" ]]; then
116+
echo "No projects to build"
117+
exit 0
118+
fi
119+
120+
echo "Projects to test: ${modified_projects}"
121+
echo "Runtimes to test: ${mac_runtimes_to_test}"
122+
echo "Building projects: ${mac_projects}"
123+
echo "Running project checks targets: ${mac_check_targets}"
124+
echo "Building runtimes: ${mac_runtimes}"
125+
echo "Running runtimes checks targets: ${mac_runtime_check_targets}"
126+
127+
# -DLLVM_DISABLE_ASSEMBLY_FILES=ON is for
128+
# https://github.com/llvm/llvm-project/issues/81967
129+
cmake -G Ninja \
130+
-B build \
131+
-S llvm \
132+
-DLLVM_ENABLE_PROJECTS="$(echo ${mac_projects} | tr ' ' ';')" \
133+
-DLLVM_ENABLE_RUNTIMES="$(echo ${mac_runtimes} | tr ' ' ';')" \
134+
-DLLVM_DISABLE_ASSEMBLY_FILES=ON \
135+
-DCMAKE_BUILD_TYPE=Release \
136+
-DLLVM_ENABLE_ASSERTIONS=ON \
137+
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
138+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
139+
140+
ninja -C build $mac_check_targets $mac_runtime_check_targets

0 commit comments

Comments
 (0)