From c7f1d079d83d91d4329f6e51b31f75e03a291ede Mon Sep 17 00:00:00 2001 From: Perry Kundert Date: Thu, 10 Dec 2020 13:00:16 -0800 Subject: [PATCH] Attempt to use standard Circle-CI tooling for Rust versioning --- .circleci/config.yml | 50 +++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6de5b32..d308cab 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,4 +1,15 @@ version: 2 + +parameters: + toolchain: + description: >- + Rust toolchain to use. Overrides the default toolchain (stable) or any + toolchain specified in the project via `rust-toolchain`. + type: string + default: '1.47' + +executor: default + jobs: build: branches: @@ -9,10 +20,8 @@ jobs: - image: rust:1.47 steps: - checkout - - run: - name: Install tooling - command: | - rustup component add clippy + - update_toolchain: + toolchain: <> - run: name: Version information @@ -20,17 +29,19 @@ jobs: cargo --version cargo clippy --version - # We ship the Cargo.lock, to support Nix derivations - # - run: - # name: Calculate dependencies - # command: cargo generate-lockfile + - clippy - - restore_cache: - keys: - - v1-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }} - - v1-bench-{{ .Branch }}-{{ .Revision }} - - v1-bench-{{ .Branch }} - - v1-bench- + - run: + # We ship the Cargo.lock, to support Nix derivations + name: Calculate dependencies + command: test -e Cargo.lock || cargo generate-lockfile + + # - restore_cache: + # keys: + # - v1-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }} + # - v1-bench-{{ .Branch }}-{{ .Revision }} + # - v1-bench-{{ .Branch }} + # - v1-bench- # DISABLED: # running 11 tests @@ -74,9 +85,14 @@ jobs: # name: Measure code coverage # command: cargo kcov - - run: - name: Run lints - command: cargo clippy + # - run: + # name: Run lints + # command: | + # if rustup component add clippy; then + # cargo clippy + # else + # echo Skipping clippy + # fi - run: name: Run unit tests