From 086f4cc27c2d78ffcf785e95252100f4e2f261af Mon Sep 17 00:00:00 2001 From: Conrad Ludgate Date: Fri, 7 May 2021 21:28:16 +0100 Subject: cache builds (#49) * cache builds * improve cache steps * un-restrict target cache * remove release cache --- .github/workflows/rust.yml | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a67e4330..0bd995b2 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -15,13 +15,21 @@ jobs: steps: - uses: actions/checkout@v2 - + - name: Install rust uses: actions-rs/toolchain@v1 with: toolchain: stable override: true + - uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }} + - name: Run cargo build run: cargo build --all --release && strip target/release/atuin @@ -37,6 +45,14 @@ jobs: toolchain: stable override: true + - uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.lock') }} + - name: Run cargo test run: cargo test --workspace @@ -53,6 +69,14 @@ jobs: override: true components: clippy + - uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.lock') }} + - name: Run clippy run: cargo clippy -- -D warnings @@ -68,6 +92,6 @@ jobs: toolchain: stable override: true components: rustfmt - + - name: Format run: cargo fmt -- --check -- cgit v1.2.3