Skip to content

Commit

Permalink
Make CI able to run non-cargo commands in channel
Browse files Browse the repository at this point in the history
  • Loading branch information
quodlibetor committed Sep 13, 2019
1 parent 5e1e2d5 commit e6ac38b
Showing 1 changed file with 27 additions and 13 deletions.
40 changes: 27 additions & 13 deletions ci/travis.sh
Expand Up @@ -8,19 +8,33 @@ set -e
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

channel() {
channel_run cargo "$@"
}

channel_run() {
if [ -n "${TRAVIS}" ]; then
if [ "${TRAVIS_RUST_VERSION}" = "${CHANNEL}" ]; then
pwd
(set -x; cargo "$@")
echo "$ $*"
"$@"
fi
elif [ -n "${APPVEYOR}" ]; then
if [ "${APPVEYOR_RUST_CHANNEL}" = "${CHANNEL}" ]; then
pwd
(set -x; cargo "$@")
echo "$ $*"
"$@"
fi
else
pwd
(set -x; cargo "+${CHANNEL}" "$@")
local cmd="$1"
shift
if [[ $cmd = cargo ]] ; then
echo "$ $cmd +${CHANNEL} $*"
"$cmd" "+${CHANNEL}" "$@"
else
echo "$ $cmd $*"
"$cmd" "$@"
fi
fi
}

Expand Down Expand Up @@ -86,7 +100,7 @@ build_only() {
}

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
channel build -v --target thumbv6m-none-eabi
Expand All @@ -112,18 +126,18 @@ rustc --version
cargo --version
node --version

CHANNEL=nightly
if [ "x${CLIPPY}" = xy ] ; then
run_clippy
else
build_and_test
fi
# CHANNEL=nightly
# if [ "x${CLIPPY}" = xy ] ; then
# run_clippy
# else
# build_and_test
# fi

CHANNEL=beta
build_and_test
# CHANNEL=beta
# build_and_test

CHANNEL=stable
build_and_test
#build_and_test
build_core_test

CHANNEL=1.13.0
Expand Down

0 comments on commit e6ac38b

Please sign in to comment.