| Crates.io | cargo-template-ci |
| lib.rs | cargo-template-ci |
| version | 0.2.0 |
| created_at | 2018-10-19 08:09:01.273404+00 |
| updated_at | 2019-07-27 12:33:11.499286+00 |
| description | Generate a CI configuration from a template and Cargo config |
| homepage | |
| repository | https://github.com/antifuchs/cargo-template-ci |
| max_upload_size | |
| id | 91450 |
| size | 56,283 |
cargo template-ci - automatically generate a fast travis.ymlIn all my rust projects, I use travis to provide continuous
integration services, and to validate that things are
correct. However, rust's commandline utilities have changed a lot (and
clippy still does!), so I had to adjust the invocations in every
single .travis.yml I had. Not fun!
So here's a little tool that will generate a .travis.yml file for your project according to a few flags, with a bunch of nice things:
Once installed, you can run this tool in a rust project with cargo template-ci. It will overwrite the project's existing .travis.yml, so
make sure you check if it did a good job!
By default, the configuration is as follows:
stable, beta, nightly.stable.nightly, but allow failures.nightly if enabled).You can configure the generated config file by editing your project's
package metadata in Cargo.toml: Everything lives under the key
package.metadata.template_ci. This project has an example that
makes clippy failures
fatal.
If your project uses Cargo workspaces, it is impossible to add package metadata to the top-level workspace configuration file. For that reason, you can also put the template-ci config into files in the repository root:
.template-ci.toml ortemplate-ci.toml, failing that:package.metadata.template_ci in Cargo.tomlNo configuration value merging is performed: The first configuration source that matches causes all other files to be ignored.
Here's a list of configurable keys:
package.metadata.template_ci.os: The operating system to run on. Defaults to linuxpackage.metadata.template_ci.dist: The operating system distribution version to run on. Defaults to xenial (Ubuntu 16.04)package.metadata.template_ci.versions: The versions of rust to run tests on, in a build matrix. Defaults to ["stable", "beta", "nightly"]There are additional matrix build settings:
package.metadata.template_ci.rustfmt: Settings for running an additional matrix build for checking rustfmt validity. Settings:
run: whether to run the build at all. Default: true.version: what version to run on. Default: stable.allow_failure: whether a non-zero exit status should break the build. Default false.package.metadata.template_ci.clippy: An additional matrix build for the clippy linter.
run: trueversion: nightlyallow_failure: truepackage.metadata.template_ci.bench: An additional matrix build for running cargo bench.
run: falseversion: nightlyallow_failure: false