Skip to content

Commit aa00897

Browse files
committed
Run shellcheck only in Travis Linux
1 parent 0a067b5 commit aa00897

File tree

4 files changed

+9
-16
lines changed

4 files changed

+9
-16
lines changed

.travis.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
sudo: required
21
dist: trusty
32
services:
43
- docker
@@ -51,11 +50,11 @@ matrix:
5150
env: MACOSX_DEPLOYMENT_TARGET=10.7 TARGET=x86_64-apple-darwin NO_ADD=1
5251

5352
install:
54-
- if [ -z "$NO_ADD" ]; then rustup target add $TARGET; fi
53+
- if [ -z "$NO_ADD" ]; then rustup target add "$TARGET"; fi
5554
- rustup component add rustfmt
5655

5756
script:
58-
- mkdir -p target/$TARGET;
57+
- mkdir -p target/"$TARGET";
5958
- >
6059
case "$TARGET" in
6160
*-linux-android) DOCKER=android ;; # Android uses a local docker image
@@ -68,6 +67,9 @@ script:
6867
else
6968
PATH="$HOME/rust/bin:$PATH" bash ci/run.sh;
7069
fi
70+
- if [ "${TRAVIS_OS_NAME}" = linux ]; then
71+
shellcheck -e SC1090 -- rustup-init.sh ci/*.sh ci/*.bash;
72+
fi
7173

7274
before_deploy:
7375
- bash ci/prepare-deploy-travis.sh

ci/build-run-docker.sh

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ if [ -f "ci/docker/$DOCKER/Dockerfile" ]; then
2828
travis_fold end "build.Dockerfile.${DOCKER}"
2929
fi
3030

31+
# shellcheck disable=SC2016
3132
docker run \
3233
--entrypoint bash \
3334
--user "$(id -u)":"$(id -g)" \

ci/run.sh

-10
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
set -ex
44

5-
printf 'toolchain versions\n------------------\n'
6-
75
rustc -vV
86
cargo -vV
97
rustfmt -vV
@@ -18,11 +16,3 @@ fi
1816
# Check the formatting last because test failures are more interesting to have
1917
# discovered for contributors lacking some platform access for testing beforehand
2018
cargo fmt --all -- --check
21-
22-
# Then check the shell scripts, if shellcheck is present (which it is on Travis CI)
23-
if command -v shellcheck > /dev/null 2>&1; then
24-
shellcheck --version
25-
shellcheck -- *.sh ci/*.sh
26-
else
27-
echo No shellcheck found, skipping.
28-
fi

ci/shared.bash

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#!/bin/false
1+
#!/bin/bash
22
#
3-
# This file is intended to be sourced, hence the invalid shebang and
4-
# not being marked as an executable file in git.
3+
# This file is intended to be sourced, so it is not being marked as
4+
# an executable file in git.
55

66
# This is from
77
# https://github.com/travis-ci/travis-build/blob/master/lib/travis/build/bash/travis_setup_env.bash

0 commit comments

Comments
 (0)