35 releases

✓ Uses Rust 2018 edition

0.9.2 Feb 14, 2020
0.9.0 Dec 8, 2019
0.8.1 Sep 29, 2019
0.7.1 Jun 2, 2019
0.1.12 Nov 3, 2017

#3 in Build Utils

Download history 11727/week @ 2019-11-08 11804/week @ 2019-11-15 12679/week @ 2019-11-22 12315/week @ 2019-11-29 13461/week @ 2019-12-06 11377/week @ 2019-12-13 6255/week @ 2019-12-20 5632/week @ 2019-12-27 10154/week @ 2020-01-03 14635/week @ 2020-01-10 16550/week @ 2020-01-17 13958/week @ 2020-01-24 7984/week @ 2020-01-31 5832/week @ 2020-02-07 3938/week @ 2020-02-14

46,820 downloads per month
Used in 24 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());
    }
    if info.branch_name.is_some() {
        println!("Branch Name: {:#?}", info.branch_name.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

See Changelog

License

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

Dependencies

~2MB
~12K SLoC