Skip to content

Commit

Permalink
ARROW-2520: [Rust] CI should also build against nightly Rust
Browse files Browse the repository at this point in the history
Author: Krisztián Szűcs <[email protected]>

Closes apache#2477 from kszucs/ARROW-2520 and squashes the following commits:

79b1e7a <Krisztián Szűcs> check against "Rust" in appceyor-install.bat
4a31a42 <Krisztián Szűcs> fix install script
99b99b6 <Krisztián Szűcs> set rust stable toolchain as default after running tests on appveyor
f941121 <Krisztián Szűcs> use rustup environment variable
15b6358 <Krisztián Szűcs> don't parenthesize
07db3d9 <Krisztián Szűcs> make travis_install_cargo executable
8af4c76 <Krisztián Szűcs> test both stable and nightly rust in the same CI step
2720e1e <Krisztián Szűcs> remove rust from allow_failures
c5dd144 <Krisztián Szűcs> separate matrix step
7983976 <Krisztián Szűcs> remove beta channel
40c0ed8 <Krisztián Szűcs> rust against rust nightly
  • Loading branch information
kszucs authored and xhochy committed Sep 9, 2018
1 parent 462fb00 commit 7a2d228
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 13 deletions.
11 changes: 4 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ matrix:
# Rust
- language: rust
cache: cargo
rust: stable
addons:
apt:
packages:
Expand All @@ -223,17 +222,15 @@ matrix:
- cmake
before_script:
- if [ $ARROW_CI_RUST_AFFECTED != "1" ]; then exit; fi
- pip install 'travis-cargo<0.2' --user && export PATH=$HOME/.local/bin:$PATH
- export CARGO_TARGET_DIR=$TRAVIS_BUILD_DIR/target
- cargo install cargo-travis || echo "Skipping cargo-travis installation as it already exists in cache"
- export PATH=$HOME/.cargo/bin:$PATH
- $TRAVIS_BUILD_DIR/ci/travis_install_cargo.sh
script:
- $TRAVIS_BUILD_DIR/ci/travis_script_rust.sh
- RUSTUP_TOOLCHAIN=stable $TRAVIS_BUILD_DIR/ci/travis_script_rust.sh
- RUSTUP_TOOLCHAIN=nightly $TRAVIS_BUILD_DIR/ci/travis_script_rust.sh || true
after_success:
- pushd ${TRAVIS_BUILD_DIR}/rust
# Run coverage for codecov.io
- mkdir -p target/kcov
- RUST_BACKTRACE=1 cargo coverage --verbose
- RUST_BACKTRACE=1 RUSTUP_TOOLCHAIN=stable cargo coverage --verbose
- bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
# Go
- language: go
Expand Down
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ environment:
GENERATOR: Ninja
CONFIGURATION: "Release"
BUILD_SCRIPT: "CMake_Build_Script"
- JOB: "Rust_Stable"
RUST_VERSION: stable
- JOB: "Rust"
TARGET: x86_64-pc-windows-msvc
USE_CLCACHE: false

Expand Down
18 changes: 16 additions & 2 deletions ci/appveyor-build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,26 @@

@echo on

if "%JOB%" == "Rust_Stable" (
cd rust
if "%JOB%" == "Rust" (
pushd rust

rustup default stable
rustup show
cargo build --target %TARGET% || exit /B
cargo build --target %TARGET% --release || exit /B
cargo test --target %TARGET% || exit /B
cargo test --target %TARGET% --release || exit /B

rustup default nightly
rustup show
cargo build --target %TARGET%
cargo build --target %TARGET% --release
cargo test --target %TARGET%
cargo test --target %TARGET% --release

rustup default stable

popd
) else (
git config core.symlinks true
git reset --hard
Expand Down
6 changes: 4 additions & 2 deletions ci/appveyor-install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@

@echo on

if "%JOB%" == "Rust_Stable" (
if "%JOB%" == "Rust" (
curl -sSf -o rustup-init.exe https://win.rustup.rs/
rustup-init.exe -y --default-host %TARGET% --default-toolchain %RUST_VERSION%
rustup-init.exe -y --default-host %TARGET% --default-toolchain stable
set "PATH=%PATH%;C:\Users\Appveyor\.cargo\bin"
rustup install stable
rustup install nightly
rustc -Vv
cargo -V
) else (
Expand Down
32 changes: 32 additions & 0 deletions ci/travis_install_cargo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env bash

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

set -e

# ensure that both toolchains are installed
rustup install stable
rustup install nightly

pip install 'travis-cargo<0.2' --user

export PATH=$HOME/.local/bin:$PATH
export CARGO_TARGET_DIR=$TRAVIS_BUILD_DIR/target

cargo install cargo-travis || echo "Skipping cargo-travis installation as it already exists in cache"
export PATH=$HOME/.cargo/bin:$PATH
4 changes: 4 additions & 0 deletions ci/travis_script_rust.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ RUST_DIR=${TRAVIS_BUILD_DIR}/rust

pushd $RUST_DIR

# show activated toolchain
rustup show

# raises on any formatting errors
rustup component add rustfmt-preview
cargo fmt --all -- --check

# raises on any warnings
cargo rustc -- -D warnings

Expand Down

0 comments on commit 7a2d228

Please sign in to comment.