Lint shell scripts in CI

This commit is contained in:
Grimes 2018-05-27 18:01:34 -07:00 committed by Greg Fitzgerald
parent a3854c229e
commit b7eec4c89f
2 changed files with 16 additions and 0 deletions

View File

@ -29,6 +29,8 @@ steps:
user: "998:997" # buildkite-agent:buildkite-agent
- command: "ci/test-cuda.sh"
label: "cuda"
- command: "ci/shellcheck.sh"
label: "shellcheck [public]"
- wait
- command: "ci/publish.sh"
label: "publish release artifacts"

14
ci/shellcheck.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash -e
#
# Reference: https://github.com/koalaman/shellcheck/wiki/Directive
cd "$(dirname "$0")/.."
set -x
docker pull koalaman/shellcheck
find . -name "*.sh" -not -regex ".*/.cargo/.*" -print0 \
| xargs -0 \
docker run -w /work -v "$PWD:/work" \
koalaman/shellcheck --color=always --external-sources --shell=bash
exit 0