about summary refs log tree commit diff
path: root/src/ci/scripts
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-10-29 19:12:01 +0000
committerbors <bors@rust-lang.org>2019-10-29 19:12:01 +0000
commitaa69777ea2902208b24b3fd77767d577ceaf6386 (patch)
treea10b62394886dfbfb294a55a71cd434c34d239ae /src/ci/scripts
parentcaa1f8d7b3b021c86a70ff62d23a07d97acff4c4 (diff)
parentdb496864601f127f260b0810919c309fe60679c5 (diff)
downloadrust-aa69777ea2902208b24b3fd77767d577ceaf6386.tar.gz
rust-aa69777ea2902208b24b3fd77767d577ceaf6386.zip
Auto merge of #65943 - tmandry:rollup-g20uvkh, r=tmandry
Rollup of 12 pull requests

Successful merges:

 - #65405 (Create new error E0742 and add long error explanation)
 - #65539 (resolve: Turn the "non-empty glob must import something" error into a lint)
 - #65724 (ci: refactor pr tools job skipping)
 - #65741 (Prevent help popup to disappear when clicking on it)
 - #65832 (Re-enable Emscripten's exception handling support)
 - #65843 (Enable dist for MIPS64 musl targets)
 - #65898 (add basic HermitCore support within libtest)
 - #65900 (proc_macro: clean up bridge::client::__run_expand{1,2} a bit.)
 - #65906 (Update mdbook to 0.3.3)
 - #65920 (Use rustc-workspace-hack for rustbook)
 - #65930 (doc: use new feature gate for c_void type)
 - #65936 (save-analysis: Account for async desugaring in async fn return types)

Failed merges:

 - #65434 (Add long error explanation for E0577)

r? @ghost
Diffstat (limited to 'src/ci/scripts')
-rwxr-xr-xsrc/ci/scripts/should-skip-this.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/ci/scripts/should-skip-this.sh b/src/ci/scripts/should-skip-this.sh
new file mode 100755
index 00000000000..f945db0ada2
--- /dev/null
+++ b/src/ci/scripts/should-skip-this.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+# Set the SKIP_JOB environment variable if this job is supposed to only run
+# when submodules are updated and they were not. The following time consuming
+# tasks will be skipped when the environment variable is present.
+
+set -euo pipefail
+IFS=$'\n\t'
+
+source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
+
+if [[ -z "${CI_ONLY_WHEN_SUBMODULES_CHANGED+x}" ]]; then
+    echo "Executing the job since there is no skip rule in effect"
+elif git diff HEAD^ | grep --quiet "^index .* 160000"; then
+    # Submodules pseudo-files inside git have the 160000 permissions, so when
+    # those files are present in the diff a submodule was updated.
+    echo "Executing the job since submodules are updated"
+else
+    echo "Not executing this job since no submodules were updated"
+    ciCommandSetEnv SKIP_JOB 1
+fi