From cdca15cf74680472b56d658d740dc239d2eca35f Mon Sep 17 00:00:00 2001 From: "Stephen M. Coakley" Date: Sun, 24 Oct 2021 16:02:29 -0500 Subject: [PATCH] Add caching to CI --- .github/workflows/ci.yml | 44 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39d136ac..5425dd46 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,20 +25,40 @@ jobs: with: submodules: true - - run: | + - name: Install system dependencies + run: | sudo apt update sudo apt install -y libkrb5-dev if: matrix.os == 'ubuntu-latest' - - uses: actions-rs/toolchain@v1 + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: "1.46.0" default: true - - run: cargo test --features ${{ env.FEATURES }},spnego,unstable-interceptors + - name: Update Cargo.lock + run: cargo update + + - name: Cache Cargo dependencies + uses: actions/cache@v2 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + cargo-${{ runner.os }}- + + - name: Run tests + run: cargo test --features ${{ env.FEATURES }},spnego,unstable-interceptors - - run: cargo run --release --example simple + - name: Run example program + run: cargo run --release --example simple analyze: runs-on: ubuntu-latest @@ -55,6 +75,22 @@ jobs: components: clippy default: true + - name: Update Cargo.lock + run: cargo update + + - name: Cache Cargo dependencies + uses: actions/cache@v2 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + cargo-${{ runner.os }}- + - name: Check Clippy lints uses: actions-rs/clippy-check@v1 with: