diff options
author | Blaž Hrastnik | 2020-06-02 01:42:41 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2020-06-02 01:42:41 +0000 |
commit | 2ea5feaeb15cefaaed66a759ec895298dbf479b4 (patch) | |
tree | 649fdbc9cba70e328c67fbbcf12f4a805f54c18c | |
parent | d232000c54696887b12bae18533a39ec32bb59fb (diff) |
ci: Add dependency caching.
-rw-r--r-- | .github/workflows/rust.yml | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 29d94615..c73370ab 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -23,6 +23,24 @@ jobs: toolchain: stable override: true + - name: Cache cargo registry + uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + + - name: Cache cargo index + uses: actions/cache@v1 + with: + path: ~/.cargo/git + key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} + + - name: Cache cargo target dir + uses: actions/cache@v1 + with: + path: target + key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} + - name: Run cargo check uses: actions-rs/cargo@v1 with: @@ -42,6 +60,24 @@ jobs: toolchain: stable override: true + - name: Cache cargo registry + uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + + - name: Cache cargo index + uses: actions/cache@v1 + with: + path: ~/.cargo/git + key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} + + - name: Cache cargo target dir + uses: actions/cache@v1 + with: + path: target + key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} + - name: Run cargo test uses: actions-rs/cargo@v1 with: @@ -62,6 +98,24 @@ jobs: override: true components: rustfmt, clippy + - name: Cache cargo registry + uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + + - name: Cache cargo index + uses: actions/cache@v1 + with: + path: ~/.cargo/git + key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} + + - name: Cache cargo target dir + uses: actions/cache@v1 + with: + path: target + key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} + - name: Run cargo fmt uses: actions-rs/cargo@v1 with: |