From af73f6cc811611eeb2616dd9775847d1042f6f39 Mon Sep 17 00:00:00 2001 From: Razican Date: Wed, 2 Jan 2019 20:01:29 +0100 Subject: [PATCH 1/2] Improved Travis-ci script --- .travis.yml | 32 +++++++++++++++++++++++++++----- Cargo.toml | 4 ++-- src/generate.rs | 4 ++-- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9149c8e..a642194 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,10 +2,32 @@ language: rust sudo: false env: global: - - RUST_BACKTRACE=1 + - RUST_BACKTRACE=1 cache: cargo -matrix: - include: - - rust: nightly - - rust: stable \ No newline at end of file +# Run builds in Linux, MacOS X and Windows +os: +- linux +- osx +- windows + +# Run builds for all the supported trains +rust: +- 1.19.0 +- stable +- beta +- nightly + +# Run the multiple tests. +script: +- | + if [[ "$TRAVIS_RUST_VERSION" == "stable" && "$TRAVIS_OS_NAME" == "linux" ]]; then + rustup component add rustfmt && + cargo fmt --verbose -- --check + fi +- | + if [[ "$TRAVIS_RUST_VERSION" == "stable" && "$TRAVIS_OS_NAME" == "linux" ]]; then + rustup component add clippy && + cargo clippy --verbose + fi +- cargo test --verbose \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index ba072c5..6f52efb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,8 +15,8 @@ readme = "README.md" repository = "https://github.com/Hoverbear/getset" [badges] -travis-ci = { repository = "https://github.com/Hoverbear/getset" } -appveyor = { repository = "https://github.com/Hoverbear/getset", service = "github" } +travis-ci = { repository = "Hoverbear/getset" } +appveyor = { repository = "Hoverbear/getset", service = "github" } [lib] proc-macro = true diff --git a/src/generate.rs b/src/generate.rs index 2edd914..6fe77b7 100644 --- a/src/generate.rs +++ b/src/generate.rs @@ -1,5 +1,5 @@ -use proc_macro2::{Ident, Span}; use proc_macro2::TokenStream as TokenStream2; +use proc_macro2::{Ident, Span}; use syn::{Attribute, Field, Lit, Meta, MetaNameValue}; pub struct GenParams { @@ -133,6 +133,6 @@ pub fn implement(field: &Field, mode: GenMode, params: GenParams) -> TokenStream } } // Don't need to do anything. - None => quote!{}, + None => quote! {}, } } From a1ba057b81e9414e50ce0c9a6ee249a701b19a4b Mon Sep 17 00:00:00 2001 From: Razican Date: Wed, 2 Jan 2019 20:39:16 +0100 Subject: [PATCH 2/2] Removed appveyor script --- Cargo.toml | 1 - appveyor.yml | 23 ----------------------- 2 files changed, 24 deletions(-) delete mode 100644 appveyor.yml diff --git a/Cargo.toml b/Cargo.toml index 6f52efb..1d56286 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,6 @@ repository = "https://github.com/Hoverbear/getset" [badges] travis-ci = { repository = "Hoverbear/getset" } -appveyor = { repository = "Hoverbear/getset", service = "github" } [lib] proc-macro = true diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 91f614f..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,23 +0,0 @@ -environment: - matrix: - - TARGET: x86_64-pc-windows-gnu - RUST_VERSION: stable - - TARGET: x86_64-pc-windows-gnu - RUST_VERSION: nightly - -install: - - curl -sSf -o rustup-init.exe https://win.rustup.rs/ - - rustup-init.exe -y --default-host %TARGET% --default-toolchain %RUST_VERSION% - - set PATH=%PATH%;C:\Users\appveyor\.cargo\bin - - rustc -Vv - - cargo -V - -# Building is done in the test phase, so we disable Appveyor's build phase. -build: false - -cache: - - C:\Users\appveyor\.cargo\registry - - target - -test_script: - - cargo test \ No newline at end of file