| 1 | #!/usr/bin/envscip-shell filesystem . . `/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 file generates a Buildkite pipeline that triggers the libc++ CI |
| 12 | # job(s) if needed. |
| 13 | # See https://buildkite.com/docs/agent/v3/cli-pipeline#pipeline-format. |
| 14 | # |
| 15 | # Invoked by CI on pre-merge check for a commit. |
| 16 | # |
| 17 | |
| 18 | if ! gitscip-shell system . . git. diff --name-only HEAD~1 | grepscip-shell system . . grep. -q -E "^libcxx/|^libcxxabi/|^libunwind/|^runtimes/|^cmake/|^clang/"; then |
| 19 | # libcxx/, libcxxabi/, libunwind/, runtimes/, cmake/ or clang/ are not affected |
| 20 | exit 0 |
| 21 | fi |
| 22 | |
| 23 | reviewID="$(gitscip-shell system . . git. log --format=%B -n 1 | sedscip-shell system . . sed. -nE 's/^Review-ID:[[:space:]]*(.+)$/\1/p')" |
| 24 | if [[ "${reviewID}" != "" ]]; then |
| 25 | buildMessage="https://llvm.org/${reviewID}" |
| 26 | else |
| 27 | buildMessage="Push to branch ${BUILDKITE_BRANCH}" |
| 28 | fi |
| 29 | |
| 30 | |
| 31 | catscip-shell system . . cat. <<EOF |
| 32 | steps: |
| 33 | - trigger: "libcxx-ci" |
| 34 | build: |
| 35 | message: "${buildMessage}" |
| 36 | commit: "${BUILDKITE_COMMIT}" |
| 37 | branch: "${BUILDKITE_BRANCH}" |
| 38 | EOF |