Skip to content

[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 1 commit into from
Jul 15, 2025
Merged
Changes from all commits
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
105 changes: 105 additions & 0 deletions .github/workflows/rust-premerge.yaml
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}
Loading