• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1restore_registry: &RESTORE_REGISTRY
2  restore_cache:
3    key: registry
4save_registry: &SAVE_REGISTRY
5  save_cache:
6    key: registry-{{ .BuildNum }}
7    paths:
8    - /usr/local/cargo/registry/index
9deps_key: &DEPS_KEY
10  key: deps-{{ checksum "~/rust-version" }}-{{ checksum "Cargo.lock" }}
11restore_deps: &RESTORE_DEPS
12  restore_cache:
13    <<: *DEPS_KEY
14save_deps: &SAVE_DEPS
15  save_cache:
16    <<: *DEPS_KEY
17    paths:
18    - target
19    - /usr/local/cargo/registry/cache
20
21version: 2
22jobs:
23  stable:
24    docker:
25    - image: rust:1.33.0
26    environment:
27      RUSTFLAGS: -D warnings
28    working_directory: ~/build
29    steps:
30    - checkout
31    - *RESTORE_REGISTRY
32    - run: cargo generate-lockfile
33    - *SAVE_REGISTRY
34    - run: rustc --version > ~/rust-version
35    - *RESTORE_DEPS
36    - run: cargo test
37    - run: cargo test --features std
38    - *SAVE_DEPS
39  nightly:
40    docker:
41    - image: rustlang/rust:nightly
42    environment:
43      RUSTFLAGS: -D warnings
44    working_directory: ~/build
45    steps:
46    - checkout
47    - *RESTORE_REGISTRY
48    - run: cargo generate-lockfile
49    - *SAVE_REGISTRY
50    - run: rustc --version > ~/rust-version
51    - *RESTORE_DEPS
52    - run: cargo test --features alloc
53    - *SAVE_DEPS
54
55workflows:
56  version: 2
57  tests:
58    jobs:
59    - stable
60    - nightly
61