Skip to content

Commit 6104aa7

Browse files
committed
ci: extract validate-toolstate into a script
1 parent af6b266 commit 6104aa7

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

src/ci/azure-pipelines/steps/run.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -144,18 +144,7 @@ steps:
144144

145145
# As a quick smoke check on the otherwise very fast mingw-check linux builder
146146
# check our own internal scripts.
147-
- bash: |
148-
set -e
149-
git clone --depth=1 https://github.com/rust-lang-nursery/rust-toolstate.git
150-
cd rust-toolstate
151-
python2.7 "$BUILD_SOURCESDIRECTORY/src/tools/publish_toolstate.py" "$(git rev-parse HEAD)" "$(git log --format=%s -n1 HEAD)" "" ""
152-
# Only check maintainers if this build is supposed to publish toolstate.
153-
# Builds that are not supposed to publish don't have the access token.
154-
if [ -n "${TOOLSTATE_PUBLISH+is_set}" ]; then
155-
TOOLSTATE_VALIDATE_MAINTAINERS_REPO=rust-lang/rust python2.7 "${BUILD_SOURCESDIRECTORY}/src/tools/publish_toolstate.py"
156-
fi
157-
cd ..
158-
rm -rf rust-toolstate
147+
- bash: src/ci/scripts/validate-toolstate.sh
159148
env:
160149
TOOLSTATE_REPO_ACCESS_TOKEN: $(TOOLSTATE_REPO_ACCESS_TOKEN)
161150
condition: and(succeeded(), not(variables.SKIP_JOB), eq(variables['IMAGE'], 'mingw-check'))

src/ci/scripts/validate-toolstate.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
# A quick smoke test to make sure publish_tooolstate.py works.
3+
4+
set -euo pipefail
5+
IFS=$'\n\t'
6+
7+
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
8+
9+
git clone --depth=1 https://github.com/rust-lang-nursery/rust-toolstate.git
10+
cd rust-toolstate
11+
python2.7 "${BUILD_SOURCESDIRECTORY}/src/tools/publish_toolstate.py" "$(git rev-parse HEAD)" "$(git log --format=%s -n1 HEAD)" "" ""
12+
# Only check maintainers if this build is supposed to publish toolstate.
13+
# Builds that are not supposed to publish don't have the access token.
14+
if [ -n "${TOOLSTATE_PUBLISH+is_set}" ]; then
15+
TOOLSTATE_VALIDATE_MAINTAINERS_REPO=rust-lang/rust python2.7 "${BUILD_SOURCESDIRECTORY}/src/tools/publish_toolstate.py"
16+
fi
17+
cd ..
18+
rm -rf rust-toolstate

0 commit comments

Comments
 (0)