Cache cargo registry
Because we do not check in a `Cargo.lock` file, dependencies may be
updated at any time. Therefore, each workflow run gets a unique cache
key.
@@ -32,6 +32,14 @@ jobs:
restore-keys: |
${{ runner.os }}-cargo-
+ - name: Cache cargo build
+ uses: actions/cache@main
+ with:
+ path: target
+ key: ${{ runner.os }}-lint-target-${{ steps.rustc.outputs.version }}-${{ github.run_id }}
+ restore-keys: |
+ ${{ runner.os }}-lint-target-${{ steps.rustc.outputs.version }}-
+
- name: cargo fmt
uses: actions-rs/cargo@v1
with:
@@ -70,6 +78,14 @@ jobs:
restore-keys: |
${{ runner.os }}-cargo-
+ - name: Cache cargo build
+ uses: actions/cache@main
+ with:
+ path: target
+ key: ${{ runner.os }}-target-${{ steps.rustc.outputs.version }}-${{ github.run_id }}
+ restore-keys: |
+ ${{ runner.os }}-target-${{ steps.rustc.outputs.version }}-
+
- name: cargo build
uses: actions-rs/cargo@v1
with:
