forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 101
[rust] Add CI Checks to Rust fork #186
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
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
name: CI Checks (Rust fork) | ||
|
||
permissions: | ||
contents: read | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
# When a PR is closed, we still start this workflow, but then skip | ||
# all the jobs, which makes it effectively a no-op. The reason to | ||
# do this is that it allows us to take advantage of concurrency groups | ||
# to cancel in progress CI jobs whenever the PR is closed. | ||
- closed | ||
push: | ||
branches: | ||
- 'rustc/**' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
premerge-checks-linux: | ||
name: Build and Test Linux | ||
if: >- | ||
github.repository_owner == 'rust-lang' && | ||
(github.event_name != 'pull_request' || github.event.action != 'closed') | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Checkout LLVM | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
with: | ||
fetch-depth: 1 | ||
- name: Free up disk space | ||
run: | | ||
curl -sSL https://raw.githubusercontent.com/rust-lang/rust/474466dc16f890083af1cdebad0aebf4d4ba88d7/src/ci/scripts/free-disk-space.sh | bash | ||
- name: Install clang-18 | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y clang-18 cmake ninja-build | ||
- name: Setup ccache | ||
uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17 | ||
with: | ||
max-size: "2000M" | ||
- name: Build and Test | ||
run: | | ||
projects_to_build='llvm;lld' | ||
project_check_targets='check-llvm check-lld' | ||
runtimes_to_build='' | ||
runtimes_check_targets='' | ||
runtimes_check_targets_needs_reconfig='' | ||
|
||
echo "Building projects: ${projects_to_build}" | ||
echo "Running project checks targets: ${project_check_targets}" | ||
echo "Building runtimes: ${runtimes_to_build}" | ||
echo "Running runtimes checks targets: ${runtimes_check_targets}" | ||
echo "Running runtimes checks requiring reconfiguring targets: ${runtimes_check_targets_needs_reconfig}" | ||
|
||
export CC=/usr/bin/clang-18 | ||
export CXX=/usr/bin/clang++-18 | ||
|
||
./.ci/monolithic-linux.sh "${projects_to_build}" "${project_check_targets}" "${runtimes_to_build}" "${runtimes_check_targets}" "${runtimes_check_targets_needs_reconfig}" | ||
|
||
premerge-check-macos: | ||
name: Build and Test macOS | ||
runs-on: macos-14 | ||
if: >- | ||
github.repository_owner == 'rust-lang' && | ||
(github.event_name != 'pull_request' || github.event.action != 'closed') | ||
steps: | ||
- name: Checkout LLVM | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
with: | ||
fetch-depth: 1 | ||
- name: Setup ccache | ||
uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17 | ||
with: | ||
max-size: "2000M" | ||
- name: Build and Test | ||
run: | | ||
projects_to_build='llvm' | ||
project_check_targets='check-llvm' | ||
|
||
echo "Building projects: ${projects_to_build}" | ||
echo "Running project checks targets: ${project_check_targets}" | ||
|
||
# -DLLVM_DISABLE_ASSEMBLY_FILES=ON is for | ||
# https://github.com/llvm/llvm-project/issues/81967 | ||
# Disable sharding in lit so that the LIT_XFAIL environment var works. | ||
cmake -G Ninja \ | ||
-B build \ | ||
-S llvm \ | ||
-DLLVM_ENABLE_PROJECTS="${projects_to_build}" \ | ||
-DLLVM_DISABLE_ASSEMBLY_FILES=ON \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DLLDB_INCLUDE_TESTS=OFF \ | ||
-DLLVM_ENABLE_ASSERTIONS=ON \ | ||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ | ||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache | ||
|
||
# The libcxx tests fail, so we are skipping the runtime targets. | ||
ninja -C build ${project_check_targets} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think we need to move away from using monolithic-linux.sh here, because it is too tightly bound to LLVM's CI runners. This now needs sccache to be installed. It's probably more robust to just do our own cmake + ninja invocations.
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 will change that.