Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
196 lines (173 sloc) 4.32 KB
version: 2
defaults: &defaults
working_directory: /tmp/repo
docker:
# specify the version you desire here
- image: rust:1
environment:
SAMPLE: "VARIABLE"
print_version: &print_version
<<: *defaults
steps:
- run:
name: Print toolchain versions
command: |
rustc --version
cargo --version
rustup --version
checkout: &checkout
<<: *defaults
steps:
- checkout
- persist_to_workspace:
root: /tmp
paths:
- repo
build: &build
<<: *defaults
steps:
- attach_workspace:
at: /tmp
- restore_cache:
keys:
- v1-dependencies-rust-{{ checksum "Cargo.toml" }}
- v1-dependencies-rust-
- run: cargo build
- save_cache:
paths:
- target
key: v1-dependencies-rust-{{ checksum "Cargo.toml" }}
- persist_to_workspace:
root: /tmp
paths:
- repo
build_release: &build_release
<<: *defaults
steps:
- attach_workspace:
at: /tmp
- restore_cache:
keys:
- v1-dependencies-rust-{{ checksum "Cargo.toml" }}
- v1-dependencies-rust-
- run: cargo build --release
- save_cache:
paths:
- target
key: v1-dependencies-rust-{{ checksum "Cargo.toml" }}
- persist_to_workspace:
root: /tmp
paths:
- repo
jobs:
checkout:
<<: *checkout
print_version:
<<: *print_version
build:
<<: *build
build_release:
<<: *build_release
fmt:
<<: *defaults
steps:
- attach_workspace:
at: /tmp
- run: rustup component add rustfmt
- run: cargo fmt
clippy:
<<: *defaults
steps:
- attach_workspace:
at: /tmp
- run: rustup component add clippy
- run: cargo clippy
check:
<<: *defaults
steps:
- attach_workspace:
at: /tmp
- run: cargo check
test:
<<: *defaults
steps:
- attach_workspace:
at: /tmp
- run: cargo test
test_release:
<<: *defaults
steps:
- attach_workspace:
at: /tmp
- run: cargo test --release
bench:
<<: *defaults
steps:
- attach_workspace:
at: /tmp
- run: cargo bench
bench_master:
<<: *defaults
steps:
- attach_workspace:
at: /tmp
- run: git checkout master
- run: cargo bench
- persist_to_workspace:
root: /tmp
paths:
- repo
deploy:
<<: *defaults
steps:
- attach_workspace:
at: /tmp
- run: echo todo
workflows:
version: 2
test:
jobs:
- checkout
- print_version
- build:
requires:
- checkout
- build_release:
requires:
- checkout
- build
- fmt:
requires:
- checkout
- check:
requires:
- checkout
- clippy:
requires:
- checkout
- test:
requires:
- build
- bench_master:
requires:
- build_release
- bench:
requires:
- bench_master
- build_release
- test_release:
requires:
- build_release
- deploy:
requires:
- build
- build_release
- fmt
- check
- clippy
- test
- test_release
- bench
filters:
branches:
only: master
You can’t perform that action at this time.