|
1 |
| -restore_registry: &RESTORE_REGISTRY |
2 |
| - restore_cache: |
3 |
| - key: registry |
4 |
| -save_registry: &SAVE_REGISTRY |
5 |
| - save_cache: |
6 |
| - key: registry-{{ .BuildNum }} |
7 |
| - paths: |
8 |
| - - /usr/local/cargo/registry/index |
9 |
| -deps_key: &DEPS_KEY |
10 |
| - key: deps-{{ checksum "~/rust-version" }}-{{ checksum "~/openssl-version" }}-{{ checksum "Cargo.lock" }} |
11 |
| -restore_deps: &RESTORE_DEPS |
12 |
| - restore_cache: |
13 |
| - <<: *DEPS_KEY |
14 |
| -save_deps: &SAVE_DEPS |
15 |
| - save_cache: |
16 |
| - <<: *DEPS_KEY |
17 |
| - paths: |
18 |
| - - target |
19 |
| - - /usr/local/cargo/registry/cache |
20 |
| -job: &JOB |
21 |
| - environment: |
22 |
| - RUSTFLAGS: -D warnings |
23 |
| - steps: |
24 |
| - - checkout |
25 |
| - - *RESTORE_REGISTRY |
26 |
| - - run: cargo generate-lockfile |
27 |
| - - *SAVE_REGISTRY |
28 |
| - - run: rustc --version > ~/rust-version |
29 |
| - - run: openssl version > ~/openssl-version |
30 |
| - - *RESTORE_DEPS |
31 |
| - - run: cargo test |
32 |
| - - run: rustdoc --test README.md -L target/debug/deps -L target/debug |
33 |
| - - *SAVE_DEPS |
| 1 | +version: 2.1 |
34 | 2 |
|
35 |
| -version: 2 |
36 | 3 | jobs:
|
37 |
| - openssl-1.1.0: |
38 |
| - <<: *JOB |
| 4 | + linux: |
| 5 | + parameters: |
| 6 | + image: |
| 7 | + type: string |
39 | 8 | docker:
|
40 |
| - - image: rust:1.21.0-stretch |
41 |
| - openssl-1.0.2: |
42 |
| - <<: *JOB |
43 |
| - docker: |
44 |
| - - image: rust:1.21.0-jessie |
| 9 | + - image: rust:<< parameters.image >> |
| 10 | + environment: |
| 11 | + RUST_BACKTRACE: 1 |
| 12 | + RUSTFLAGS: -D warnings |
| 13 | + steps: |
| 14 | + - checkout |
| 15 | + - restore_cache: |
| 16 | + key: registry |
| 17 | + - run: cargo generate-lockfile |
| 18 | + - save_cache: |
| 19 | + key: registry-{{ .BuildNum }} |
| 20 | + paths: |
| 21 | + - /usr/local/cargo/registry/index |
| 22 | + - restore_cache: |
| 23 | + key: deps-<< parameters.image >>-{{ checksum "Cargo.lock" }} |
| 24 | + - run: cargo test |
| 25 | + - run: rustdoc --test README.md -L target/debug/deps -L target/debug |
| 26 | + - save_cache: |
| 27 | + key: deps-<< parameters.image >>-{{ checksum "Cargo.lock" }} |
| 28 | + paths: |
| 29 | + - /usr/local/cargo/registry/cache |
| 30 | + - target |
| 31 | + |
| 32 | + macos: |
| 33 | + parameters: |
| 34 | + version: |
| 35 | + type: string |
| 36 | + macos: |
| 37 | + xcode: "9.0" |
| 38 | + environment: |
| 39 | + RUST_BACKTRACE: 1 |
| 40 | + RUSTFLAGS: -D warnings |
| 41 | + steps: |
| 42 | + - checkout |
| 43 | + - run: curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain << parameters.version >> |
| 44 | + - run: ln -s ~/.cargo/bin/* /usr/local/bin |
| 45 | + - restore_cache: |
| 46 | + key: macos-registry |
| 47 | + - run: cargo generate-lockfile |
| 48 | + - save_cache: |
| 49 | + key: macos-registry-{{ .BuildNum }} |
| 50 | + paths: |
| 51 | + - ~/.cargo/registry/index |
| 52 | + - restore_cache: |
| 53 | + key: macos-deps-<< parameters.version >> |
| 54 | + - run: cargo test |
| 55 | + - save_cache: |
| 56 | + key: macos-deps-<< parameters.version >> |
| 57 | + paths: |
| 58 | + - ~/.cargo/registry/cache |
| 59 | + - target |
45 | 60 |
|
46 | 61 | workflows:
|
47 |
| - version: 2 |
48 |
| - tests: |
| 62 | + test: |
49 | 63 | jobs:
|
50 |
| - - openssl-1.1.0 |
51 |
| - - openssl-1.0.2 |
| 64 | + - linux: |
| 65 | + name: openssl-1.1.0 |
| 66 | + image: 1.26.2-stretch |
| 67 | + - linux: |
| 68 | + name: openssl-1.0.2 |
| 69 | + image: 1.26.2-jessie |
| 70 | + - macos: |
| 71 | + version: 1.26.2 |
0 commit comments