
Some CI runs are seeing issues with failures running the artifact upload step. They seem related to https://github.com/actions/upload-artifact/issues/569. We should continue the workflow and ignore errors in the upload artifact step if it fails so that users do not see a red CI that is not due to their changes. Fixes #154155.
182 lines
7.1 KiB
YAML
182 lines
7.1 KiB
YAML
name: CI Checks
|
|
|
|
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:
|
|
- 'release/**'
|
|
|
|
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 == 'llvm' &&
|
|
(github.event_name != 'pull_request' || github.event.action != 'closed')
|
|
runs-on: llvm-premerge-linux-runners
|
|
steps:
|
|
- name: Checkout LLVM
|
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
with:
|
|
fetch-depth: 2
|
|
- name: Build and Test
|
|
run: |
|
|
git config --global --add safe.directory '*'
|
|
|
|
source <(git diff --name-only HEAD~1...HEAD | python3 .ci/compute_projects.py)
|
|
|
|
if [[ "${projects_to_build}" == "" ]]; then
|
|
echo "No projects to build"
|
|
exit 0
|
|
fi
|
|
|
|
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=/opt/llvm/bin/clang
|
|
export CXX=/opt/llvm/bin/clang++
|
|
|
|
# This environment variable is passes into the container through the
|
|
# runner pod definition. This differs between our two clusters which
|
|
# why we do not hardcode it.
|
|
export SCCACHE_GCS_BUCKET=$CACHE_GCS_BUCKET
|
|
export SCCACHE_GCS_RW_MODE=READ_WRITE
|
|
|
|
# Set the idle timeout to zero to ensure sccache runs for the
|
|
# entire duration of the job. Otherwise it might stop if we run
|
|
# several test suites in a row and discard statistics that we want
|
|
# to save in the end.
|
|
export SCCACHE_IDLE_TIMEOUT=0
|
|
sccache --start-server
|
|
|
|
./.ci/monolithic-linux.sh "${projects_to_build}" "${project_check_targets}" "${runtimes_to_build}" "${runtimes_check_targets}" "${runtimes_check_targets_needs_reconfig}" "${enable_cir}"
|
|
- name: Upload Artifacts
|
|
# In some cases, Github will fail to upload the artifact. We want to
|
|
# continue anyways as a failed artifact upload is an infra failure, not
|
|
# a checks failure.
|
|
# https://github.com/actions/upload-artifact/issues/569
|
|
continue-on-error: true
|
|
if: '!cancelled()'
|
|
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
|
with:
|
|
name: Premerge Artifacts (Linux)
|
|
path: artifacts/
|
|
retention-days: 5
|
|
include-hidden-files: 'true'
|
|
|
|
premerge-checks-windows:
|
|
name: Build and Test Windows
|
|
if: >-
|
|
github.repository_owner == 'llvm' &&
|
|
(github.event_name != 'pull_request' || github.event.action != 'closed')
|
|
runs-on: llvm-premerge-windows-2022-runners
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
steps:
|
|
- name: Checkout LLVM
|
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
with:
|
|
fetch-depth: 2
|
|
- name: Compute Projects
|
|
id: vars
|
|
run: |
|
|
source <(git diff --name-only HEAD~1...HEAD | python .ci/compute_projects.py)
|
|
|
|
if [[ "${projects_to_build}" == "" ]]; then
|
|
echo "No projects to build"
|
|
fi
|
|
|
|
echo "Building projects: ${projects_to_build}"
|
|
echo "Running project checks targets: ${project_check_targets}"
|
|
|
|
echo "windows-projects=${projects_to_build}" >> $GITHUB_OUTPUT
|
|
echo "windows-check-targets=${project_check_targets}" >> $GITHUB_OUTPUT
|
|
- name: Build and Test
|
|
if: ${{ steps.vars.outputs.windows-projects != '' }}
|
|
shell: cmd
|
|
run: |
|
|
call C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat -arch=amd64 -host_arch=amd64
|
|
# See the comments above in the Linux job for why we define each of
|
|
# these environment variables.
|
|
bash -c "export SCCACHE_GCS_BUCKET=$CACHE_GCS_BUCKET; export SCCACHE_GCS_RW_MODE=READ_WRITE; export SCCACHE_IDLE_TIMEOUT=0; sccache --start-server; .ci/monolithic-windows.sh \"${{ steps.vars.outputs.windows-projects }}\" \"${{ steps.vars.outputs.windows-check-targets }}\""
|
|
- name: Upload Artifacts
|
|
# In some cases, Github will fail to upload the artifact. We want to
|
|
# continue anyways as a failed artifact upload is an infra failure, not
|
|
# a checks failure.
|
|
# https://github.com/actions/upload-artifact/issues/569
|
|
continue-on-error: true
|
|
if: '!cancelled()'
|
|
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
|
with:
|
|
name: Premerge Artifacts (Windows)
|
|
path: artifacts/
|
|
retention-days: 5
|
|
include-hidden-files: 'true'
|
|
|
|
premerge-check-macos:
|
|
name: MacOS Premerge Checks
|
|
runs-on: macos-14
|
|
if: >-
|
|
github.repository_owner == 'llvm' &&
|
|
(startswith(github.ref_name, 'release/') ||
|
|
startswith(github.base_ref, 'release/')) &&
|
|
(github.event_name != 'pull_request' || github.event.action != 'closed')
|
|
steps:
|
|
- name: Checkout LLVM
|
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
with:
|
|
fetch-depth: 2
|
|
- name: Setup ccache
|
|
uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17
|
|
with:
|
|
max-size: "2000M"
|
|
- name: Install Ninja
|
|
uses: llvm/actions/install-ninja@main
|
|
- name: Build and Test
|
|
run: |
|
|
source <(git diff --name-only HEAD~2..HEAD | python3 .ci/compute_projects.py)
|
|
|
|
if [[ "${projects_to_build}" == "" ]]; then
|
|
echo "No projects to build"
|
|
exit 0
|
|
fi
|
|
|
|
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}
|