]> git.lizzy.rs Git - rust.git/blobdiff - src/ci/shared.sh
Rollup merge of #97764 - RalfJung:strict, r=dtolnay
[rust.git] / src / ci / shared.sh
index 1f218bc834608325883ff198edbff566df015aad..8a88c56194c604a3e351d7dbd853d4c13c6f5cfb 100644 (file)
@@ -28,11 +28,7 @@ function retry {
 }
 
 function isCI {
-    [[ "${CI-false}" = "true" ]] || isAzurePipelines || isGitHubActions
-}
-
-function isAzurePipelines {
-    [[ "${TF_BUILD-False}" = "True" ]]
+    [[ "${CI-false}" = "true" ]] || isGitHubActions
 }
 
 function isGitHubActions {
@@ -63,9 +59,7 @@ function isCiBranch {
     fi
     name="$1"
 
-    if isAzurePipelines; then
-        [[ "${BUILD_SOURCEBRANCHNAME}" = "${name}" ]]
-    elif isGitHubActions; then
+    if isGitHubActions; then
         [[ "${GITHUB_REF}" = "refs/heads/${name}" ]]
     else
         echo "isCiBranch only works inside CI!"
@@ -74,10 +68,7 @@ function isCiBranch {
 }
 
 function ciBaseBranch {
-    if isAzurePipelines; then
-        echo "unsupported on Azure Pipelines"
-        exit 1
-    elif isGitHubActions; then
+    if isGitHubActions; then
         echo "${GITHUB_BASE_REF#refs/heads/}"
     else
         echo "ciBaseBranch only works inside CI!"
@@ -86,9 +77,7 @@ function ciBaseBranch {
 }
 
 function ciCommit {
-    if isAzurePipelines; then
-        echo "${BUILD_SOURCEVERSION}"
-    elif isGitHubActions; then
+    if isGitHubActions; then
         echo "${GITHUB_SHA}"
     else
         echo "ciCommit only works inside CI!"
@@ -97,9 +86,7 @@ function ciCommit {
 }
 
 function ciCheckoutPath {
-    if isAzurePipelines; then
-        echo "${BUILD_SOURCESDIRECTORY}"
-    elif isGitHubActions; then
+    if isGitHubActions; then
         echo "${GITHUB_WORKSPACE}"
     else
         echo "ciCheckoutPath only works inside CI!"
@@ -114,9 +101,7 @@ function ciCommandAddPath {
     fi
     path="$1"
 
-    if isAzurePipelines; then
-        echo "##vso[task.prependpath]${path}"
-    elif isGitHubActions; then
+    if isGitHubActions; then
         echo "${path}" >> "${GITHUB_PATH}"
     else
         echo "ciCommandAddPath only works inside CI!"
@@ -132,9 +117,7 @@ function ciCommandSetEnv {
     name="$1"
     value="$2"
 
-    if isAzurePipelines; then
-        echo "##vso[task.setvariable variable=${name}]${value}"
-    elif isGitHubActions; then
+    if isGitHubActions; then
         echo "${name}=${value}" >> "${GITHUB_ENV}"
     else
         echo "ciCommandSetEnv only works inside CI!"