32 releases (7 breaking)

✓ Uses Rust 2018 edition

0.8.1 Sep 29, 2019
0.7.1 Jun 2, 2019
0.4.0 Mar 13, 2019
0.3.0 Dec 10, 2018
0.1.12 Nov 3, 2017

#5 in Build Utils

Download history 4877/week @ 2019-06-16 5060/week @ 2019-06-23 5538/week @ 2019-06-30 7182/week @ 2019-07-07 7712/week @ 2019-07-14 7524/week @ 2019-07-21 8484/week @ 2019-07-28 9386/week @ 2019-08-04 10758/week @ 2019-08-11 10588/week @ 2019-08-18 10540/week @ 2019-08-25 10402/week @ 2019-09-01 10757/week @ 2019-09-08 11451/week @ 2019-09-15 11780/week @ 2019-09-22

40,353 downloads per month
Used in 30 crates (2 directly)

Apache-2.0

800KB
1.5K SLoC

ci_info

crates.io Build Status Build status codecov
license Libraries.io for GitHub Documentation downloads
Built with cargo-make

Provides current CI environment information.

Overview

This library main goal is to provide development/build tools such as cargo-make the needed information on the current CI environment.
The code is based on the ci-info npm module.

Usage

Simply include the library and invoke the get function to pull all info as follows:

extern crate ci_info;

fn main() {
    // Just check if a CI environment is detected.
    let ci = ci_info::is_ci();
    println!("Is CI: {}", ci);

    // Get CI environment information
    let info = ci_info::get();
    println!("Is CI: {}", info.ci);
    if info.vendor.is_some() {
        println!("Vendor: {:#?}", info.vendor.unwrap());
        println!("Name: {:#?}", info.name.unwrap());
    }
    if info.pr.is_some() {
        println!("Is PR: {:#?}", info.pr.unwrap());
    }
}

Installation

In order to use this library, just add it as a dependency:

[dependencies]
ci_info = "*"

There is optional serde support that can be enabled via the serde-1 feature:

[dependencies]
ci_info = { version = "*", features = ["serde-1"] }

API Documentation

See full docs at: API Docs

Contributing

See contributing guide

Release History

Date Version Description
2019-09-29 v0.8.1 Adding support for GitHub Actions, Heroku, Renderer and Now
2019-08-13 v0.8.0 Adding support for Nevercode
2019-05-08 v0.5.0 Use envmnt library for environment variables support
2019-03-13 v0.4.0 Added pr flag and vendor name
2018-12-10 v0.3.0 Added optional serde support
2017-10-10 v0.1.0 Initial release.

License

Developed by Sagie Gur-Ari and licensed under the Apache 2 open source license.

Dependencies

~1MB