Skip to content

Commit

Permalink
Build improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
iliekturtles committed Aug 3, 2018
1 parent c3b7d39 commit d19e455
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 80 deletions.
102 changes: 52 additions & 50 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,65 @@
# Appveyor configuration template for Rust using rustup for Rust installation
# https://github.com/starkat99/appveyor-rust

## Operating System (VM environment) ##
os: Visual Studio 2017

## Build Matrix ##
build: false
skip_tags: true
cache:
- C:\Users\appveyor\.cargo\registry
- target
environment:
global:
CHANNEL: stable
PROJECT_NAME: uom
# APPVEYOR_CACHE_SKIP_RESTORE: true # Uncomment when caching causes problems
matrix:
# Oldest supported
- TARGET: i686-pc-windows-msvc
CHANNEL: 1.20.0
- TARGET: i686-pc-windows-gnu
CHANNEL: 1.20.0
- TARGET: x86_64-pc-windows-msvc
CHANNEL: 1.20.0
- TARGET: x86_64-pc-windows-gnu
CHANNEL: 1.20.0
# Stable channel
- TARGET: i686-pc-windows-msvc
CHANNEL: stable
- TARGET: i686-pc-windows-gnu
CHANNEL: stable
- TARGET: x86_64-pc-windows-msvc
CHANNEL: stable
- TARGET: x86_64-pc-windows-gnu
CHANNEL: stable
# Beta channel
- TARGET: i686-pc-windows-msvc
CHANNEL: beta
- TARGET: i686-pc-windows-gnu
CHANNEL: beta
- TARGET: x86_64-pc-windows-msvc
CHANNEL: beta
- TARGET: x86_64-pc-windows-gnu
CHANNEL: beta
# Nightly channel
- TARGET: i686-pc-windows-msvc
CHANNEL: nightly
- TARGET: i686-pc-windows-gnu
CHANNEL: nightly
- TARGET: x86_64-pc-windows-msvc
CHANNEL: nightly
- TARGET: x86_64-pc-windows-gnu
CHANNEL: nightly

### MSVC Toolchains ###
# Stable 64-bit MSVC
- channel: stable
target: x86_64-pc-windows-msvc
# Stable 32-bit MSVC
- channel: stable
target: i686-pc-windows-msvc
# Beta 64-bit MSVC
- channel: beta
target: x86_64-pc-windows-msvc
# Beta 32-bit MSVC
- channel: beta
target: i686-pc-windows-msvc

### GNU Toolchains ###
# Stable 64-bit GNU
- channel: stable
target: x86_64-pc-windows-gnu
# Stable 32-bit GNU
- channel: stable
target: i686-pc-windows-gnu
# Beta 64-bit GNU
- channel: beta
target: x86_64-pc-windows-gnu
# Beta 32-bit GNU
- channel: beta
target: i686-pc-windows-gnu

### Allowed failures ###
matrix:
allow_failures:
- channel: nightly
- CHANNEL: nightly

## Install Script ##
install:
- appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
- rustup-init -yv --default-toolchain %channel% --default-host %target%
- set PATH=%PATH%;%USERPROFILE%\.cargo\bin
- rustc -vV
- cargo -vV
- appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
- rustup-init -yv --default-toolchain %CHANNEL% --default-host %TARGET%
- set PATH=%PATH%;%USERPROFILE%\.cargo\bin
- rustc -Vv
- cargo -V

## Build Script ##
build: false
test_script:
- cargo build --verbose --no-default-features --features "autoconvert usize u8 u16 u32 u64 isize i8 i16 i32 i64 bigint biguint rational rational32 rational64 bigrational f32 f64 si std use_serde"
- cargo test --verbose --no-run --no-default-features --features "autoconvert usize u8 u16 u32 u64 isize i8 i16 i32 i64 bigint biguint rational rational32 rational64 bigrational f32 f64 std use_serde"
- cargo test --all --verbose --features "use_serde"
- cargo test --all --verbose --features "use_serde"

notifications:
- provider: Email
on_build_success: false
- provider: Email
on_build_success: false
65 changes: 36 additions & 29 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,56 @@
language: rust
cache: cargo
sudo: false

# Dependencies of kcov, used by coverage
sudo: required
addons:
apt:
packages:
- libcurl4-openssl-dev
- libelf-dev
- libdw-dev
- binutils-dev
- cmake
sources:
- kalakris-cmake
- libssl-dev

rust:
- stable
- beta
- nightly
- 1.20.0
- 1.20.0 # Oldest supported
#- stable # Done by explicit job
- beta
- nightly

matrix:
allow_failures:
- rust: nightly
- rust: nightly
include:
- env: TEST
rust: stable
script: |
cargo test --verbose --features "use_serde ${TRAVIS_RUST_VERSION//./_}"
cargo test --manifest-path tests/feature_check/Cargo.toml --verbose --features "use_serde ${TRAVIS_RUST_VERSION//./_}"
cargo test --verbose --no-default-features --features "autoconvert f32 f64 si use_serde ${TRAVIS_RUST_VERSION//./_}"
cargo test --verbose --no-run --no-default-features --features "autoconvert usize u8 u16 u32 u64 isize i8 i16 i32 i64 bigint biguint rational rational32 rational64 bigrational f32 f64 std use_serde ${TRAVIS_RUST_VERSION//./_}"
- env: RUSTFMT
rust: 1.26.1
rust: stable
install:
- rustup component add rustfmt-preview
script:
- cargo fmt -- --write-mode=diff

before_script: |
test "${TRAVIS_RUST_VERSION//./_}" != "stable" ||
(test -x /home/travis/.cargo/bin/cargo-coveralls || cargo install cargo-travis) ||
(test $(grep "cargo-travis" /home/travis/.cargo/.crates.toml | sed -r "s/\"cargo-travis ([^\ ]+).+/\1/") = $(cargo search cargo-travis --limit 1 | sed -r "s/cargo-travis \(([^\)]+)\).+/\1/") || cargo install cargo-travis --force)
- cargo fmt -- --check
- env: RUSTFLAGS="-D warnings"
rust: stable
script:
- RUSTFLAGS="-D warnings" cargo check --tests
- env: CLIPPY
rust: nightly
install:
- rustup component add clippy-preview
script:
- cargo clippy -- -D clippy
- env: TARPAULIN
rust: stable
script:
- docker run --security-opt seccomp=unconfined -v "$PWD:/volume" xd009642/tarpaulin sh -c "cargo build && cargo tarpaulin --ciserver travis-ci --coveralls $TRAVIS_JOB_ID"

script: |
cargo build --verbose --no-default-features --features "autoconvert usize u8 u16 u32 u64 isize i8 i16 i32 i64 bigint biguint rational rational32 rational64 bigrational f32 f64 si std use_serde" &&
cargo test --verbose --no-run --no-default-features --features "autoconvert usize u8 u16 u32 u64 isize i8 i16 i32 i64 bigint biguint rational rational32 rational64 bigrational f32 f64 std use_serde ${TRAVIS_RUST_VERSION//./_}" &&
cargo test --verbose --features "use_serde ${TRAVIS_RUST_VERSION//./_}" &&
cargo test --manifest-path tests/feature_check/Cargo.toml --verbose --features "${TRAVIS_RUST_VERSION//./_}"
install:
- rustc -Vv
- cargo -V

after_success: |
test "${TRAVIS_RUST_VERSION//./_}" != "stable" || cargo coveralls
script:
- cargo test --verbose --features "use_serde ${TRAVIS_RUST_VERSION//./_}"
- cargo test --manifest-path tests/feature_check/Cargo.toml --verbose --features "use_serde ${TRAVIS_RUST_VERSION//./_}"

notifications:
email:
Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@

// Compile with `no_std` when the `std` feature is not specified.
#![cfg_attr(not(feature = "std"), no_std)]
// Default rustc lints.
// Rustc lints.
// #![warn(bare_trait_objects)] // Requires rustc 1.27.
#![warn(missing_copy_implementations)]
#![warn(missing_debug_implementations)]
#![warn(missing_docs)]
Expand Down

0 comments on commit d19e455

Please sign in to comment.