Speeding CI builds

This commit is contained in:
Lilian A. Moraru 2017-12-19 01:04:49 +02:00 committed by Andrew Gallant
parent 162e085b98
commit 636bbc7c8f
6 changed files with 31 additions and 23 deletions

View File

@ -1,4 +1,5 @@
language: rust language: rust
cache: cargo
env: env:
global: global:
@ -12,6 +13,7 @@ addons:
- zsh - zsh
matrix: matrix:
fast_finish: true
include: include:
# Nightly channel. # Nightly channel.
# (All *nix releases are done on the nightly channel to take advantage # (All *nix releases are done on the nightly channel to take advantage

View File

@ -29,6 +29,9 @@ name = "rg"
name = "integration" name = "integration"
path = "tests/tests.rs" path = "tests/tests.rs"
[workspace]
members = [ "grep", "globset", "ignore", "termcolor", "wincolor" ]
[dependencies] [dependencies]
atty = "0.2.2" atty = "0.2.2"
bytecount = "0.2" bytecount = "0.2"

View File

@ -1,4 +1,20 @@
# Inspired from https://github.com/habitat-sh/habitat/blob/master/appveyor.yml
cache:
- c:\cargo\registry
- c:\cargo\git
- c:\projects\ripgrep\target
init:
- mkdir c:\cargo
- mkdir c:\rustup
- SET PATH=c:\cargo\bin;%PATH%
clone_folder: c:\projects\ripgrep
environment: environment:
CARGO_HOME: "c:\\cargo"
RUSTUP_HOME: "c:\\rustup"
CARGO_TARGET_DIR: "c:\\projects\\ripgrep\\target"
global: global:
PROJECT_NAME: ripgrep PROJECT_NAME: ripgrep
RUST_BACKTRACE: full RUST_BACKTRACE: full
@ -12,12 +28,14 @@ environment:
- TARGET: x86_64-pc-windows-msvc - TARGET: x86_64-pc-windows-msvc
CHANNEL: stable CHANNEL: stable
matrix:
fast_finish: true
# Install Rust and Cargo # Install Rust and Cargo
# (Based on from https://github.com/rust-lang/libc/blob/master/appveyor.yml) # (Based on from https://github.com/rust-lang/libc/blob/master/appveyor.yml)
install: install:
- curl -sSf -o rustup-init.exe https://win.rustup.rs/ - curl -sSf -o rustup-init.exe https://win.rustup.rs/
- rustup-init.exe -y --default-host %TARGET% - rustup-init.exe -y --default-host %TARGET% --no-modify-path
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
- if defined MSYS2_BITS set PATH=%PATH%;C:\msys64\mingw%MSYS2_BITS%\bin - if defined MSYS2_BITS set PATH=%PATH%;C:\msys64\mingw%MSYS2_BITS%\bin
- rustc -V - rustc -V
- cargo -V - cargo -V
@ -28,12 +46,7 @@ build: false
# Equivalent to Travis' `script` phase # Equivalent to Travis' `script` phase
# TODO modify this phase as you see fit # TODO modify this phase as you see fit
test_script: test_script:
- cargo test --verbose - cargo test --verbose --all
- cargo test --verbose --manifest-path grep/Cargo.toml
- cargo test --verbose --manifest-path globset/Cargo.toml
- cargo test --verbose --manifest-path ignore/Cargo.toml
- cargo test --verbose --manifest-path wincolor/Cargo.toml
- cargo test --verbose --manifest-path termcolor/Cargo.toml
before_deploy: before_deploy:
# Generate artifacts for release # Generate artifacts for release

View File

@ -4,9 +4,6 @@ set -ex
. $(dirname $0)/utils.sh . $(dirname $0)/utils.sh
# "." - dot is for the current directory(ripgrep itself)
components=( . grep globset ignore termcolor )
# NOTE Workaround for rust-lang/rust#31907 - disable doc tests when cross compiling # NOTE Workaround for rust-lang/rust#31907 - disable doc tests when cross compiling
# This has been fixed in the nightly channel but it would take a while to reach the other channels # This has been fixed in the nightly channel but it would take a while to reach the other channels
disable_cross_doctests() { disable_cross_doctests() {
@ -18,18 +15,11 @@ disable_cross_doctests() {
fi fi
} }
run_cargo() {
for component in "${components[@]}"; do
cargo "${1:?}" --target $TARGET --verbose --manifest-path "${component}/Cargo.toml"
done
}
main() { main() {
# disable_cross_doctests # disable_cross_doctests
run_cargo clean cargo build --target "${TARGET}" --verbose --all
run_cargo build
if [ "$(architecture)" = "amd64" ] || [ "$(architecture)" = "i386" ]; then if [ "$(architecture)" = "amd64" ] || [ "$(architecture)" = "i386" ]; then
run_cargo test cargo test --target "${TARGET}" --verbose --all
"$( dirname "${0}" )/test_complete.sh" "$( dirname "${0}" )/test_complete.sh"
fi fi

View File

@ -33,6 +33,3 @@ tempdir = "0.3.5"
[features] [features]
simd-accel = ["globset/simd-accel"] simd-accel = ["globset/simd-accel"]
[profile.release]
debug = true

View File

@ -8,6 +8,8 @@ Note that on non-Windows platforms, this crate is empty but will compile.
# Example # Example
```no_run ```no_run
# #[cfg(windows)]
# {
use wincolor::{Console, Color, Intense}; use wincolor::{Console, Color, Intense};
let mut con = Console::stdout().unwrap(); let mut con = Console::stdout().unwrap();
@ -15,6 +17,7 @@ con.fg(Intense::Yes, Color::Cyan).unwrap();
println!("This text will be intense cyan."); println!("This text will be intense cyan.");
con.reset().unwrap(); con.reset().unwrap();
println!("This text will be normal."); println!("This text will be normal.");
# }
``` ```
*/ */