Skip to content

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

Merged
merged 21 commits into from
Jan 31, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/premerge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
push:
branches:
- 'main'
- 'release/**'
Copy link
Contributor

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?

Copy link
Collaborator Author

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.

Copy link
Contributor

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).

Copy link
Collaborator Author

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.

Copy link
Contributor

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.


jobs:
premerge-checks-linux:
Expand Down Expand Up @@ -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 '*'
Copy link
Contributor

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?


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
Loading