From 5e5fbe724b2b620d7cbabd8e0d7bcf6b65a4180c Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Thu, 21 May 2020 13:10:26 +0300 Subject: [PATCH] examples: Reuse cargo registry cache across OSes The registry filesystem format and the git repositories work across platforms, no need to maintain runner-specific caches for these. --- examples.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/examples.md b/examples.md index 8ead3cf..21a5f6c 100644 --- a/examples.md +++ b/examples.md @@ -251,7 +251,7 @@ Esy allows you to export built dependencies and import pre-built dependencies. ...(Build job)... # Re-export dependencies if anything has changed or if it is the first time - - name: Setting dependency cache + - name: Setting dependency cache run: | esy export-dependencies if: steps.restore-cache.outputs.cache-hit != 'true' @@ -428,13 +428,18 @@ When dependencies are installed later in the workflow, we must specify the same ## Rust - Cargo ```yaml -- uses: actions/cache@v2 +- name: Cache cargo dependencies + uses: actions/cache@v2 with: path: | ~/.cargo/registry ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + key: cargo-deps-${{ hashFiles('**/Cargo.lock') }} +- name: Cache cargo build + uses: actions/cache@v2 + with: + path: target + key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} ``` ## Scala - SBT