Make CI able to run non-cargo commands in `channel`

This commit is contained in:
Brandon W Maister 2019-09-13 15:24:28 -04:00
parent 5e1e2d5633
commit e8c708d81b
1 changed files with 18 additions and 4 deletions

View File

@ -8,19 +8,33 @@ set -e
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
channel() { channel() {
channel_run cargo "$@"
}
channel_run() {
if [ -n "${TRAVIS}" ]; then if [ -n "${TRAVIS}" ]; then
if [ "${TRAVIS_RUST_VERSION}" = "${CHANNEL}" ]; then if [ "${TRAVIS_RUST_VERSION}" = "${CHANNEL}" ]; then
pwd pwd
(set -x; cargo "$@") echo "$ $*"
"$@"
fi fi
elif [ -n "${APPVEYOR}" ]; then elif [ -n "${APPVEYOR}" ]; then
if [ "${APPVEYOR_RUST_CHANNEL}" = "${CHANNEL}" ]; then if [ "${APPVEYOR_RUST_CHANNEL}" = "${CHANNEL}" ]; then
pwd pwd
(set -x; cargo "$@") echo "$ $*"
"$@"
fi fi
else else
pwd pwd
(set -x; cargo "+${CHANNEL}" "$@") local cmd="$1"
shift
if [[ $cmd = cargo ]] ; then
echo "$ $cmd +${CHANNEL} $*"
"$cmd" "+${CHANNEL}" "$@"
else
echo "$ $cmd $*"
"$cmd" "$@"
fi
fi fi
} }
@ -86,7 +100,7 @@ build_only() {
} }
build_core_test() { build_core_test() {
rustup target add thumbv6m-none-eabi --toolchain $CHANNEL channel_run rustup target add thumbv6m-none-eabi --toolchain "$CHANNEL"
( (
cd ci/core-test cd ci/core-test
channel build -v --target thumbv6m-none-eabi channel build -v --target thumbv6m-none-eabi