Skip to content

Commit 866e029

Browse files
authored
Merge pull request #1916 from lzutao/ci-bash
build: Transform most CI scripts to bash
2 parents 7cd6a2c + ac0463b commit 866e029

File tree

25 files changed

+83
-95
lines changed

25 files changed

+83
-95
lines changed

.travis.yml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,14 @@ matrix:
7373
if: branch != master
7474
env: MACOSX_DEPLOYMENT_TARGET=10.7 TARGET=i686-apple-darwin
7575

76-
- name: clippy/rustup-init.sh
76+
- name: rustfmt/clippy/rustup-init.sh/shellcheck
7777
language: minimal
7878
install:
7979
- |
8080
sh ./rustup-init.sh --default-toolchain=beta -y;
8181
. "$HOME"/.cargo/env;
82-
rustup component add clippy;
82+
rustup component add rustfmt clippy;
8383
script:
84-
- cargo clippy --all --all-targets
8584
- |
8685
docker run \
8786
--volume "$TRAVIS_BUILD_DIR":/checkout:ro \
@@ -90,6 +89,11 @@ matrix:
9089
-it \
9190
centos:6 \
9291
sh ./ci/raw_init.sh;
92+
- shellcheck -s dash -- rustup-init.sh;
93+
- git ls-files -- '*.sh' | xargs shellcheck -s dash -e SC1090;
94+
- git ls-files -- '*.bash' | xargs shellcheck -s bash -e SC1090;
95+
- cargo fmt --all -- --check;
96+
- cargo clippy --all --all-targets
9397
before_deploy:
9498
deploy:
9599

@@ -120,23 +124,13 @@ script:
120124
esac
121125
- |
122126
if [ -n "$DOCKER" ]; then
123-
sh ci/build-run-docker.sh "$DOCKER" "$TARGET" "$SKIP_TESTS";
127+
bash ci/build-run-docker.bash "$DOCKER" "$TARGET" "$SKIP_TESTS";
124128
else
125-
sh ci/run.sh;
126-
fi
127-
128-
# Check the formatting last because test failures are more interesting to have
129-
# discovered for contributors lacking some platform access for testing beforehand
130-
- |
131-
if [ "${TARGET}" = x86_64-unknown-linux-gnu ]; then
132-
shellcheck -s dash -e SC1090 -- rustup-init.sh ci/*.sh;
133-
rustup component add rustfmt;
134-
rustfmt -vV;
135-
cargo fmt --all -- --check;
129+
bash ci/run.bash;
136130
fi
137131
138132
before_deploy:
139-
- sh ci/prepare-deploy-travis.sh
133+
- bash ci/prepare-deploy-travis.bash
140134

141135
deploy:
142136
- provider: s3

ci/build-run-docker.sh renamed to ci/build-run-docker.bash

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
script_dir=$(cd "$(dirname "$0")" && pwd)
44
root_dir="${script_dir}/.."
55

6-
. "${script_dir}/shared.sh"
6+
. "${script_dir}/shared.bash"
77

88
set -e
99
# Disable cause it makes shared script not to work properly
@@ -19,7 +19,7 @@ SKIP_TESTS="$3"
1919

2020
travis_fold start "fetch.image.${TARGET}"
2121
travis_time_start
22-
travis_do_cmd sh ci/fetch-rust-docker.sh "${TARGET}"
22+
travis_do_cmd bash ci/fetch-rust-docker.bash "${TARGET}"
2323
travis_time_finish
2424
travis_fold end "fetch.image.${TARGET}"
2525

@@ -52,7 +52,7 @@ docker run \
5252
--init \
5353
--rm \
5454
"${DOCKER}" \
55-
-c 'PATH="${PATH}":/rustc-sysroot/bin sh ci/run.sh'
55+
-c 'PATH="${PATH}":/rustc-sysroot/bin bash ci/run.bash'
5656

5757
# check that rustup-init was built with ssl support
5858
# see https://github.com/rust-lang/rustup.rs/issues/1051

ci/deploy.sh renamed to ci/deploy.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
# Usage:
66
#
77
# 1. Deploy the release on the dev environment:
8-
# ./deploy.sh dev VERSION_NUMBER
8+
# ./deploy.bash dev VERSION_NUMBER
99
#
1010
# 2. Test everything works correctly:
1111
# RUSTUP_UPDATE_ROOT=https://dev-static.rust-lang.org/rustup rustup self update
1212
#
1313
# 3. Deploy the release to the prod environment:
14-
# ./deploy.sh prod VERSION_NUMBER
14+
# ./deploy.bash prod VERSION_NUMBER
1515

1616
set -euo pipefail
1717
IFS=$'\n\t'
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
FROM rust-aarch64-unknown-linux-gnu
22

3-
ENV CC_aarch64_unknown_linux_gnu=aarch64-unknown-linux-gnueabi-gcc
4-
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-unknown-linux-gnueabi-gcc
3+
ENV CC_aarch64_unknown_linux_gnu=aarch64-unknown-linux-gnueabi-gcc \
4+
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-unknown-linux-gnueabi-gcc

ci/docker/android/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ RUN apt-get update && \
1111
make \
1212
pkg-config
1313

14-
COPY ci/docker/scripts/sccache.sh /scripts/
15-
RUN sh /scripts/sccache.sh
14+
COPY ci/docker/scripts/sccache.bash /scripts/
15+
RUN bash /scripts/sccache.bash
1616

1717
RUN apt-get install -y --no-install-recommends \
1818
unzip \
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
FROM rust-arm-unknown-linux-gnueabi
22

3-
ENV CC_arm_unknown_linux_gnueabi=arm-unknown-linux-gnueabi-gcc
4-
ENV CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABI_LINKER=arm-unknown-linux-gnueabi-gcc
3+
ENV CC_arm_unknown_linux_gnueabi=arm-unknown-linux-gnueabi-gcc \
4+
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABI_LINKER=arm-unknown-linux-gnueabi-gcc
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
FROM rust-arm-unknown-linux-gnueabihf
22

3-
ENV CC_arm_unknown_linux_gnueabihf=arm-unknown-linux-gnueabihf-gcc
4-
ENV CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-unknown-linux-gnueabihf-gcc
3+
ENV CC_arm_unknown_linux_gnueabihf=arm-unknown-linux-gnueabihf-gcc \
4+
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-unknown-linux-gnueabihf-gcc
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
FROM rust-armv7-unknown-linux-gnueabihf
22

3-
ENV CC_armv7_unknown_linux_gnueabihf=armv7-unknown-linux-gnueabihf-gcc
4-
ENV CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=armv7-unknown-linux-gnueabihf-gcc
3+
ENV CC_armv7_unknown_linux_gnueabihf=armv7-unknown-linux-gnueabihf-gcc \
4+
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=armv7-unknown-linux-gnueabihf-gcc
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
FROM rust-mips-unknown-linux-gnu
22

3-
ENV CC_mips_unknown_linux_gnu=mips-linux-gnu-gcc
4-
ENV CARGO_TARGET_MIPS_UNKNOWN_LINUX_GNU_LINKER=mips-linux-gnu-gcc
3+
ENV CC_mips_unknown_linux_gnu=mips-linux-gnu-gcc \
4+
CARGO_TARGET_MIPS_UNKNOWN_LINUX_GNU_LINKER=mips-linux-gnu-gcc
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
FROM rust-mips64-unknown-linux-gnuabi64
22

3-
ENV CC_mips64_unknown_linux_gnuabi64=mips64-linux-gnuabi64-gcc
4-
ENV CARGO_TARGET_MIPS64_UNKNOWN_LINUX_GNUABI64_LINKER=mips64-linux-gnuabi64-gcc
3+
ENV CC_mips64_unknown_linux_gnuabi64=mips64-linux-gnuabi64-gcc \
4+
CARGO_TARGET_MIPS64_UNKNOWN_LINUX_GNUABI64_LINKER=mips64-linux-gnuabi64-gcc

0 commit comments

Comments
 (0)