From 14e1f845f3da1787837ade150ce37dffcf1e205f Mon Sep 17 00:00:00 2001 From: Kaleb Elwert Date: Wed, 29 Jan 2020 14:07:22 -0800 Subject: [PATCH] Add features to travis.yml --- .travis.yml | 58 +++++++++++++++++++++++++++++++++++++------ examples/build-bot.rs | 7 ++++-- 2 files changed, 56 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2ef5006..1ae447e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,59 @@ language: rust -rust: stable sudo: false -script: - - cargo test --all --features "toml_config yaml_config json_config" - - cargo build - # No idea how to fix this, since we don't depend on futures-preview directly. - # - rustdoc --test README.md --extern irc=target/debug/libirc.rlib -L target/debug/deps --edition 2018 - - cargo run --example build-bot + +jobs: + allow_failures: + - stage: test + rust: beta + env: FEATURES=default + - stage: test + rust: nightly + env: FEATURES=default + + include: + # Default features + - &test + rust: stable + env: FEATURES=default + script: + - cargo test --all --no-default-features --features "$FEATURES" + - cargo build --no-default-features --features "$FEATURES" + - cargo run --no-default-features --features "$FEATURES" --example build-bot + + # No features + - <<: *test + env: FEATURES= + + # CTCP on without toml + - <<: *test + env: FEATURES=ctcp + # CTCP on w/toml (this is the same as default) + #- <<: *test + # env: FEATURES=ctcp toml_config + # nochanlists on without toml + - <<: *test + env: FEATURES=nochanlists + # nochanlists on w/toml + - <<: *test + env: FEATURES=nochanlists toml_config + + # Beta + - <<: *test + rust: beta + env: FEATURES=default + # Nightly + - <<: *test + rust: nightly + env: FEATURES=default + +# No idea how to fix this, since we don't depend on futures-preview directly. +# - rustdoc --test README.md --extern irc=target/debug/libirc.rlib -L target/debug/deps --edition 2018 + notifications: email: false irc: + on_failure: always + on_success: never channels: - "ircs://irc.pdgn.co:6697/#commits" template: diff --git a/examples/build-bot.rs b/examples/build-bot.rs index 4972fa6..5228e1b 100644 --- a/examples/build-bot.rs +++ b/examples/build-bot.rs @@ -11,10 +11,12 @@ async fn main() -> irc::error::Result<()> { let branch = env::var("TRAVIS_BRANCH").unwrap(); let commit = env::var("TRAVIS_COMMIT").unwrap(); let commit_message = env::var("TRAVIS_COMMIT_MESSAGE").unwrap(); + let features = env::var("FEATURES").unwrap(); let config = Config { nickname: Some("irc-crate-ci".to_owned()), server: Some("irc.pdgn.co".to_owned()), + alt_nicks: vec!["[irc-crate-ci]".to_owned()], use_ssl: true, ..Default::default() }; @@ -31,11 +33,12 @@ async fn main() -> irc::error::Result<()> { client.send_privmsg( "#commits", format!( - "[{}/{}] ({}) {}", + "[{}/{}] ({}) {} [{}]", repository_slug, branch, &commit[..7], - commit_message + commit_message, + features, ), )?;