1#!/usr/bin/env bash
2#===----------------------------------------------------------------------===##
3#
4# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5# See https://llvm.org/LICENSE.txt for license information.
6# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7#
8#===----------------------------------------------------------------------===##
9
10#
11# This script generates the appropriate libc++ CI pipeline based on which project(s) were changed.
12#
13
14if git diff --name-only HEAD~1 | grep -q -E "^libcxx/|^libcxxabi/|^libunwind/|^runtimes/|^cmake/"; then
15  LIBCXX_CHANGED=true
16fi
17
18if git diff --name-only HEAD~1 | grep -q -E "^clang/"; then
19  CLANG_CHANGED=true
20fi
21
22if [[ "${CLANG_CHANGED}" == "true" && "${LIBCXX_CHANGED}" != "true" ]]; then
23  cat libcxx/utils/ci/buildkite-pipeline-clang.yml
24else
25  cat libcxx/utils/ci/buildkite-pipeline.yml
26fi
27