diff --git a/.github/workflows/libcxx-trigger-buildkite.yaml b/.github/workflows/libcxx-trigger-buildkite.yaml new file mode 100644 index 0000000000000..d274f027838c7 --- /dev/null +++ b/.github/workflows/libcxx-trigger-buildkite.yaml @@ -0,0 +1,37 @@ +# This workflow triggers the Buildkite pipeline for libc++. +# +# The Buildkite pipeline implements pre-commit CI checks on platforms +# where the Github actions runner can't be used. + +name: "[libc++] Trigger Buildkite pipeline" +on: + pull_request_target: + paths: + - 'libcxx/**' + - 'libcxxabi/**' + - 'libunwind/**' + - 'runtimes/**' + - 'cmake/**' + schedule: + # Run nightly at 08:00 UTC (aka 00:00 Pacific, aka 03:00 Eastern) + - cron: '0 8 * * *' + +permissions: + contents: read # Default everything to read-only + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + trigger_buildkite: + runs-on: ubuntu-latest + steps: + - name: Trigger Buildkite pipeline + uses: buildkite/trigger-pipeline-action@f0dcd5ae74452a8d17d473227c9d212dcc1eb8f9 # v2.4.0 + with: + buildkite_api_access_token: ${{ secrets.BUILDKITE_API_ACCESS_TOKEN }} + pipeline: llvm-project/libcxx-ci + branch: ${{ github.ref_name }} + commit: ${{ github.sha }} + message: "Triggered by GitHub Actions PR against ${{ github.ref_name }}" diff --git a/libcxx/utils/ci/buildkite-pipeline-trigger.sh b/libcxx/utils/ci/buildkite-pipeline-trigger.sh deleted file mode 100755 index 4661cd54fad42..0000000000000 --- a/libcxx/utils/ci/buildkite-pipeline-trigger.sh +++ /dev/null @@ -1,34 +0,0 @@ -# ===----------------------------------------------------------------------===## -# -# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -# See https://llvm.org/LICENSE.txt for license information. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -# -# ===----------------------------------------------------------------------===## - -# -# This script determines whether the libc++ Buildkite pipeline should be triggered -# on a change. This is required because Buildkite gets notified for every PR in the -# LLVM monorepo, and we make it a no-op unless the libc++ pipeline needs to be triggered. -# - -# Set by buildkite -: ${BUILDKITE_PULL_REQUEST_BASE_BRANCH:=} - -# Fetch origin to have an up to date merge base for the diff. -git fetch origin -# List of files affected by this commit -: ${MODIFIED_FILES:=$(git diff --name-only origin/${BUILDKITE_PULL_REQUEST_BASE_BRANCH}...HEAD)} - -echo "Files modified:" >&2 -echo "$MODIFIED_FILES" >&2 -modified_dirs=$(echo "$MODIFIED_FILES" | cut -d'/' -f1 | sort -u) -echo "Directories modified:" >&2 -echo "$modified_dirs" >&2 - -# If libc++ or one of the runtimes directories changed, trigger the libc++ Buildkite pipeline. -if echo "$modified_dirs" | grep -q -E "^(libcxx|libcxxabi|libunwind|runtimes|cmake)$"; then - buildkite-agent pipeline upload libcxx/utils/ci/buildkite-pipeline.yml -else - echo "No Buildkite jobs to trigger" -fi