-
Notifications
You must be signed in to change notification settings - Fork 13.6k
workflows/premerge: Add macOS testing for release branch #124303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-github-workflow Author: Tom Stellard (tstellar) ChangesFull diff: https://github.com/llvm/llvm-project/pull/124303.diff 1 Files Affected:
diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml
index 30f4fc807f3a57..bdbe0537c89a62 100644
--- a/.github/workflows/premerge.yaml
+++ b/.github/workflows/premerge.yaml
@@ -10,6 +10,7 @@ on:
push:
branches:
- 'main'
+ - 'release/**'
jobs:
premerge-checks-linux:
@@ -70,3 +71,70 @@ jobs:
export CXX=/opt/llvm/bin/clang++
./.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})" "$(echo ${linux_runtimes} | tr ' ' ';')" "$(echo ${linux_runtime_check_targets})"
+
+
+ permerge-check-macos:
+ runs-on: macos-14
+ if: >-
+ github.repository_owner == 'llvm' &&
+ (startswith(github.ref_name, 'release/') ||
+ startswith(github.base_ref, 'refs/heads/release/')
+ steps:
+ - name: Checkout LLVM
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 2
+ - name: Setup ccache
+ uses: hendrikmuhs/[email protected]
+ with:
+ max-size: "2000M"
+ - name: Install Ninja
+ uses: llvm/actions/install-ninja@main
+ - name: Build and Test
+ run: |
+ git config --global --add safe.directory '*'
+
+ modified_files=$(git diff --name-only HEAD~1...HEAD)
+ modified_dirs=$(echo "$modified_files" | cut -d'/' -f1 | sort -u)
+
+ echo $modified_files
+ echo $modified_dirs
+
+ . ./.ci/compute-projects.sh
+
+ all_projects="clang clang-tools-extra lld lldb llvm mlir"
+ modified_projects="$(keep-modified-projects ${all_projects})"
+
+ mac_check_targets=$(check-targets ${modified_projects} | sort | uniq | tr '\n' ' ')
+ mac_projects=$(add-dependencies ${modified_projects} | sort | uniq | tr '\n' ' ')
+
+ mac_runtimes_to_test=$(compute-runtimes-to-test ${modified_projects})
+ mac_runtime_check_targets=$(check-targets ${mac_runtimes_to_test} | sort | uniq | tr '\n' ' ')
+ mac_runtimes=$(echo ${mac_runtimes_to_test} | tr ' ' '\n' | sort | uniq | tr '\n' ' ')
+
+ if [[ "${mac_projects}" == "" ]]; then
+ echo "No projects to build"
+ exit 0
+ fi
+
+ echo "Projects to test: ${modified_projects}"
+ echo "Runtimes to test: ${mac_runtimes_to_test}"
+ echo "Building projects: ${mac_projects}"
+ echo "Running project checks targets: ${mac_check_targets}"
+ echo "Building runtimes: ${mac_runtimes}"
+ echo "Running runtimes checks targets: ${mac_runtime_check_targets}"
+
+ # -DLLVM_DISABLE_ASSEMBLY_FILES=ON is for
+ # https://github.com/llvm/llvm-project/issues/81967
+ cmake -G Ninja \
+ -B build \
+ -S llvm \
+ -DLLVM_ENABLE_PROJECTS="$(echo ${mac_projects} | tr ' ' ';')" \
+ -DLLVM_ENABLE_RUNTIMES="$(echo ${mac_runtimes} | tr ' ' ';')" \
+ -DLLVM_DISABLE_ASSEMBLY_FILES=ON \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DLLVM_ENABLE_ASSERTIONS=ON \
+ -DCMAKE_C_COMPILER_LAUNCHER=ccache \
+ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
+
+ ninja -C build $mac_check_targets $mac_runtime_check_targets
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems reasonable enough to me. I'm assuming this has been tested somewhere else given that it is gated on changes being in the release branch?
@@ -10,6 +10,7 @@ on: | |||
push: | |||
branches: | |||
- 'main' | |||
- 'release/**' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you only want this for post-submit testing on the release branch? Is this just for testing currently similar to what we're doing for Linux?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to do pre-commit and post-commit testing, which is what we are currently doing on the release branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right.
The plan is to enable premerge testing on the release branch around when we do it on main
?
When exactly do you need this ready by? The LLVM 20 branch date? (Just so I can have a better idea of when we need the new premerge to be up and running).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to have the mac testing ready by the LLVM 20 branch date. For Windows and Linux we are already covered on the release branch by buildkite, so there is no rush to start using the new GitHub Actions workflow for those platforms.
If the new workflow isn't ready. I can patch the workflow file in the release branch to drop the:
paths:
- .github/workflows/premerge.yaml
And also disable the linux job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. I'd like to have everything ready by then, but can't make any guarantees. We'll probably have to backport some patches to the release branch as once we validate the new premerge workflow, we want to stop running the Buildkite pipeline, but they should be lowrisk (only impacting CI), and I can help with that.
.github/workflows/premerge.yaml
Outdated
uses: llvm/actions/install-ninja@main | ||
- name: Build and Test | ||
run: | | ||
git config --global --add safe.directory '*' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming this was copied from the Linux build? Can you try a build without it?
This reverts commit 7d57c01e93cb987e1cb2a7f101c148949f706db7.
@boomanaiden154 I tested this in my fork and it is passing now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM if the job is passing on your end.
/cherry-pick b89617d |
/pull-request #125161 |
Also, remove the old pre-merge tests since Linux and Windows are tested on buildkite now. (cherry picked from commit b89617d)
No description provided.