diff options
author | Conrad Ludgate <conradludgate@gmail.com> | 2021-05-07 21:28:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-07 20:28:16 +0000 |
commit | 086f4cc27c2d78ffcf785e95252100f4e2f261af (patch) | |
tree | 6a9688399d41f616c9303fcb12e83f96a75a0c3f /.github/workflows | |
parent | 1c59f85ea8b6e64e5e43d9fe49c07a84806ef079 (diff) |
cache builds (#49)
* cache builds
* improve cache steps
* un-restrict target cache
* remove release cache
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/rust.yml | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a67e43302..0bd995b24 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 |