brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 4661cd5 Raw
35 lines · bash
1# ===----------------------------------------------------------------------===##2#3# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4# See https://llvm.org/LICENSE.txt for license information.5# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6#7# ===----------------------------------------------------------------------===##8 9#10# This script determines whether the libc++ Buildkite pipeline should be triggered11# on a change. This is required because Buildkite gets notified for every PR in the12# LLVM monorepo, and we make it a no-op unless the libc++ pipeline needs to be triggered.13#14 15# Set by buildkite16: ${BUILDKITE_PULL_REQUEST_BASE_BRANCH:=}17 18# Fetch origin to have an up to date merge base for the diff.19git fetch origin20# List of files affected by this commit21: ${MODIFIED_FILES:=$(git diff --name-only origin/${BUILDKITE_PULL_REQUEST_BASE_BRANCH}...HEAD)}22 23echo "Files modified:" >&224echo "$MODIFIED_FILES" >&225modified_dirs=$(echo "$MODIFIED_FILES" | cut -d'/' -f1 | sort -u)26echo "Directories modified:" >&227echo "$modified_dirs" >&228 29# If libc++ or one of the runtimes directories changed, trigger the libc++ Buildkite pipeline.30if echo "$modified_dirs" | grep -q -E "^(libcxx|libcxxabi|libunwind|runtimes|cmake)$"; then31    buildkite-agent pipeline upload libcxx/utils/ci/buildkite-pipeline.yml32else33    echo "No Buildkite jobs to trigger"34fi35