From 5973d1827dfe03f25a91f2d97926e92257cb1afe Mon Sep 17 00:00:00 2001 From: Florian Atteneder Date: Mon, 2 Dec 2024 13:35:14 +0100 Subject: [PATCH] also trigger build if PR gets merged --- pipelines/main/launch_unsigned_jobs.yml | 15 ++++++++++----- pipelines/main/launch_upload_jobs.yml | 6 ++++-- pipelines/scheduled/launch_unsigned_jobs.yml | 9 ++++++--- pipelines/scheduled/launch_upload_jobs.yml | 3 ++- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/pipelines/main/launch_unsigned_jobs.yml b/pipelines/main/launch_unsigned_jobs.yml index 86ee5573..5866350e 100644 --- a/pipelines/main/launch_unsigned_jobs.yml +++ b/pipelines/main/launch_unsigned_jobs.yml @@ -55,7 +55,8 @@ steps: - *pr-labels commands: | FORCE=$(test -n "$(echo $${PULL_REQUEST_LABELS} | grep -E "\bci-force-build\b")" && echo 1 || echo 0) - BUILD=$(($${TRIGGER_BUILD} || $${FORCE})) + MERGED=$(test "$${BUILDKITE_PULL_REQUEST}" = "false" && echo 1 || echo 0) + BUILD=$(($${TRIGGER_BUILD} || $${FORCE} || $${MERGED}})) ### Launch Linux build jobs # Regular: GROUP="Build" \ @@ -112,7 +113,8 @@ steps: buildkite-agent pipeline upload .buildkite/pipelines/main/misc/doctest.yml buildkite-agent pipeline upload .buildkite/pipelines/main/misc/pdf_docs/build_pdf_docs.yml FORCE=$(test -n "$(echo $${PULL_REQUEST_LABELS} | grep -E "\bci-force-build\b")" && echo 1 || echo 0) - BUILD=$(($${TRIGGER_BUILD} || $${FORCE})) + MERGED=$(test "$${BUILDKITE_PULL_REQUEST}" = "false" && echo 1 || echo 0) + BUILD=$(($${TRIGGER_BUILD} || $${FORCE} || $${MERGED})) if [[ $${BUILD} == 1 ]]; then buildkite-agent pipeline upload .buildkite/pipelines/main/misc/analyzegc.yml buildkite-agent pipeline upload .buildkite/pipelines/main/misc/embedding.yml @@ -141,7 +143,8 @@ steps: commands: | export ALLOW_FAIL="false" FORCE=$(test -n "$(echo $${PULL_REQUEST_LABELS} | grep -E "\bci-force-build\b")" && echo 1 || echo 0) - BUILD=$(($${TRIGGER_BUILD} || $${FORCE})) + MERGED=$(test "$${BUILDKITE_PULL_REQUEST}" = "false" && echo 1 || echo 0) + BUILD=$(($${TRIGGER_BUILD} || $${FORCE} || $${MERGED}})) if [[ $${BUILD} == 1 ]]; then buildkite-agent pipeline upload .buildkite/pipelines/main/misc/gcext.yml buildkite-agent pipeline upload .buildkite/pipelines/main/misc/test_revise.yml @@ -187,7 +190,8 @@ steps: commands: | export ALLOW_FAIL="true" FORCE=$(test -n "$(echo $${PULL_REQUEST_LABELS} | grep -E "\bci-force-build\b")" && echo 1 || echo 0) - BUILD=$(($${TRIGGER_BUILD} || $${FORCE})) + MERGED=$(test "$${BUILDKITE_PULL_REQUEST}" = "false" && echo 1 || echo 0) + BUILD=$(($${TRIGGER_BUILD} || $${FORCE} || $${MERGED}})) # Launch Linux allowed-to-fail build jobs GROUP="Allow Fail" \ BUILD="$${BUILD}" \ @@ -223,7 +227,8 @@ steps: commands: | export ALLOW_FAIL="true" FORCE=$(test -n "$(echo $${PULL_REQUEST_LABELS} | grep -E "\bci-force-build\b")" && echo 1 || echo 0) - BUILD=$(($${TRIGGER_BUILD} || $${FORCE})) + MERGED=$(test "$${BUILDKITE_PULL_REQUEST}" = "false" && echo 1 || echo 0) + BUILD=$(($${TRIGGER_BUILD} || $${FORCE} || $${MERGED}})) if [[ $${BUILD} == 1 ]]; then ### Launch Linux allowed-to-fail test jobs. # Regular: diff --git a/pipelines/main/launch_upload_jobs.yml b/pipelines/main/launch_upload_jobs.yml index d793580e..f2e405a9 100644 --- a/pipelines/main/launch_upload_jobs.yml +++ b/pipelines/main/launch_upload_jobs.yml @@ -43,7 +43,8 @@ steps: export BUILDKITE_PLUGIN_CRYPTIC_BASE64_SIGNED_JOB_ID_SECRET export ALLOW_FAIL="false" FORCE=$(test -n "$(echo $${PULL_REQUEST_LABELS} | grep -E "\bci-force-build\b")" && echo 1 || echo 0) - BUILD=$(($${TRIGGER_BUILD} || $${FORCE})) + MERGED=$(test "$${BUILDKITE_PULL_REQUEST}" = "false" && echo 1 || echo 0) + BUILD=$(($${TRIGGER_BUILD} || $${FORCE} || $${MERGED}})) if [[ $${BUILD} == 1 ]]; then ##### Launch `upload_*` jobs to store tarballs into S3 once tests are done ### Linux: @@ -106,7 +107,8 @@ steps: # Explicitly pass along the cryptic token to child pipelines export BUILDKITE_PLUGIN_CRYPTIC_BASE64_SIGNED_JOB_ID_SECRET FORCE=$(test -n "$(echo $${PULL_REQUEST_LABELS} | grep -E "\bci-force-build\b")" && echo 1 || echo 0) - BUILD=$(($${TRIGGER_BUILD} || $${FORCE})) + MERGED=$(test "$${BUILDKITE_PULL_REQUEST}" = "false" && echo 1 || echo 0) + BUILD=$(($${TRIGGER_BUILD} || $${FORCE} || $${MERGED}})) export ALLOW_FAIL="true" diff --git a/pipelines/scheduled/launch_unsigned_jobs.yml b/pipelines/scheduled/launch_unsigned_jobs.yml index 8604f49c..f20a46db 100644 --- a/pipelines/scheduled/launch_unsigned_jobs.yml +++ b/pipelines/scheduled/launch_unsigned_jobs.yml @@ -42,7 +42,8 @@ steps: - *pr-labels commands: | FORCE=$(test -n "$(echo $${PULL_REQUEST_LABELS} | grep -E "\bci-force-build\b")" && echo 1 || echo 0) - BUILD=$(($${TRIGGER_BUILD} || $${FORCE})) + MERGED=$(test "$${BUILDKITE_PULL_REQUEST}" = "false" && echo 1 || echo 0) + BUILD=$(($${TRIGGER_BUILD} || $${FORCE} || $${MERGED}})) GROUP="Source Build" \ ALLOW_FAIL="false" \ BUILD="$${BUILD}" \ @@ -61,7 +62,8 @@ steps: repo_url: "https://github.com/JuliaCI/julia-buildkite" commands: | FORCE=$(test -n "$(echo $${PULL_REQUEST_LABELS} | grep -E "\bci-force-build\b")" && echo 1 || echo 0) - BUILD=$(($${TRIGGER_BUILD} || $${FORCE})) + MERGED=$(test "$${BUILDKITE_PULL_REQUEST}" = "false" && echo 1 || echo 0) + BUILD=$(($${TRIGGER_BUILD} || $${FORCE} || $${MERGED}})) if [[ $${BUILD} == 1 ]]; then GROUP="Source Tests (Allow Fail)" \ ALLOW_FAIL="true" \ @@ -83,7 +85,8 @@ steps: - *pr-labels commands: | FORCE=$(test -n "$(echo $${PULL_REQUEST_LABELS} | grep -E "\bci-force-build\b")" && echo 1 || echo 0) - BUILD=$(($${TRIGGER_BUILD} || $${FORCE})) + MERGED=$(test "$${BUILDKITE_PULL_REQUEST}" = "false" && echo 1 || echo 0) + BUILD=$(($${TRIGGER_BUILD} || $${FORCE} || $${MERGED}})) GROUP="no_GPL" \ ALLOW_FAIL="false" \ BUILD="$${BUILD}" \ diff --git a/pipelines/scheduled/launch_upload_jobs.yml b/pipelines/scheduled/launch_upload_jobs.yml index 303039fa..17bac57a 100644 --- a/pipelines/scheduled/launch_upload_jobs.yml +++ b/pipelines/scheduled/launch_upload_jobs.yml @@ -32,7 +32,8 @@ steps: # Explicitly pass along the cryptic token to child pipelines export BUILDKITE_PLUGIN_CRYPTIC_BASE64_SIGNED_JOB_ID_SECRET FORCE=$(test -n "$(echo $${PULL_REQUEST_LABELS} | grep -E "\bci-force-build\b")" && echo 1 || echo 0) - BUILD=$(($${TRIGGER_BUILD} || $${FORCE})) + MERGED=$(test "$${BUILDKITE_PULL_REQUEST}" = "false" && echo 1 || echo 0) + BUILD=$(($${TRIGGER_BUILD} || $${FORCE} || $${MERGED}})) if [[ $${BUILD} == 1 ]]; then # Launch `upload_*` jobs to store tarballs into S3 once tests are done bash .buildkite/utilities/arches_pipeline_upload.sh \