.github: Cache cargo registry/index/build
@@ -58,6 +58,24 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v1
+ - 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 build
+ uses: actions/cache@v1
+ with:
+ path: target
+ key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('Cargo.lock') }}
+
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
@@ -117,6 +135,24 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v1
+ - 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 build
+ uses: actions/cache@v1
+ with:
+ path: target
+ key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('Cargo.lock') }}
+
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
