Skip to content

Commit

Permalink
Upgrade CircleCI image to use a more recent Rust compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
pkolaczk committed Sep 13, 2022
1 parent cc02580 commit e35f507
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 27 deletions.
82 changes: 56 additions & 26 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
version: 2

jobs:
build-and-test:
format:
docker:
- image: cimg/rust:1.63.0
steps:
- checkout
- run:
name: Version information
command: |
rustc --version; cargo --version; rustup --version
- run:
name: Install formatter
command: |
rustup component add rustfmt
- run:
name: Check format
command: |
cargo fmt --all -- --check
build:
docker:
- image: circleci/rust:latest
- image: cimg/rust:1.63.0
environment:
RUSTFLAGS: '-D warnings'
steps:
Expand All @@ -27,50 +45,62 @@ jobs:
- target/debug/.fingerprint
- target/debug/build
- target/debug/deps
- run:
name: Test
command: |
export RUST_BACKTRACE=1
cargo test
format:

clippy:
docker:
- image: circleci/rust:latest
- image: cimg/rust:1.63.0
steps:
- checkout
- run:
name: Version information
command: |
rustc --version; cargo --version; rustup --version
- run:
name: Install formatter
name: Install Clippy
command: |
rustup component add rustfmt
rustup component add clippy
- run:
name: Check format
name: Run Clippy
command: |
cargo fmt --all -- --check
lint:
cargo clippy --all -- -D warnings -D rust-2018-idioms
test:
docker:
- image: circleci/rust:latest
- image: cimg/rust:1.63.0
environment:
RUSTFLAGS: '-D warnings'
steps:
- checkout
- run:
name: Version information
command: |
rustc --version; cargo --version; rustup --version
name: Calculate dependencies
command: |
rustc --version >rust-version
test -e Cargo.lock || cargo generate-lockfile
- restore_cache:
keys:
- cargo-cache-v1-{{ arch }}-{{checksum "rust-version"}}-{{ checksum "Cargo.lock" }}
- run:
name: Install Clippy
command: |
rustup component add clippy
name: Build
command: |
cargo build --all
- save_cache:
key: cargo-cache-v1-{{ arch }}-{{checksum "rust-version"}}-{{ checksum "Cargo.lock" }}
paths:
- /usr/local/cargo/registry
- target/debug/.fingerprint
- target/debug/build
- target/debug/deps
- run:
name: Run Clippy
name: Test
command: |
cargo clippy --all -- -D warnings -D rust-2018-idioms
export RUST_BACKTRACE=1
cargo test
workflows:
version: 2
build-and-test:
all-checks:
jobs:
- build-and-test
- format
- lint
- build
- clippy
- test
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e35f507

Please sign in to comment.