From e617f8c662470e946cdf0c32d5b42b8263577522 Mon Sep 17 00:00:00 2001 From: Joel Wachsler Date: Mon, 11 Jul 2022 02:07:48 +0200 Subject: [PATCH] Add caching --- .github/workflows/ci.yml | 64 ++++++++++++++++++++++++----------- .github/workflows/publish.yml | 1 + 2 files changed, 45 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c35ff9..3881030 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,26 +5,6 @@ on: - '**' - '!main' jobs: - lint: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: Install latest stable - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - components: rustfmt, clippy - - - name: Run cargo check - uses: actions-rs/cargo@v1 - with: - command: check - - - name: Run cargo clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -D warnings test: runs-on: ubuntu-22.04 services: @@ -35,13 +15,57 @@ jobs: - 8080:8080 steps: - uses: actions/checkout@v3 + + - uses: actions/cache@v2 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }} + - name: Install latest stable uses: actions-rs/toolchain@v1 with: toolchain: stable + profile: minimal + override: true - name: Run tests uses: actions-rs/cargo@v1 with: command: test args: --workspace + + fmt: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + + - name: Install latest stable + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + components: rustfmt + override: true + + - name: Run cargo fmt + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + + clippy: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + + - name: Install latest stable + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + components: clippy + override: true + + - name: Run cargo clippy + uses: actions-rs/cargo@v1 + with: + command: clippy + args: -- -D warnings diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2e7a7cd..33c4d8b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -46,6 +46,7 @@ jobs: with: toolchain: stable profile: minimal + override: true - name: Login uses: actions-rs/cargo@v1