From adbd4a304dd96d27b9397f6da9bad9de39602d69 Mon Sep 17 00:00:00 2001 From: liushuyu Date: Thu, 28 May 2020 15:37:54 -0600 Subject: [PATCH] ci: add caching --- .github/workflows/test-build.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 3b41c3e..2e2961c 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -19,6 +19,30 @@ jobs: run: sudo apt-get update && sudo apt-get install -y libwebkit2gtk-4.0-dev libssl-dev if: runner.os == 'Linux' + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - name: Get cargo cache directory path + id: cargo-cache-dir-path + run: echo "::set-output name=dir::$HOME/.cargo/" + + - uses: actions/cache@v2 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - uses: actions/cache@v2 + id: cargo-cache + with: + path: ${{ steps.cargo-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- + - uses: actions/setup-node@v1 with: node-version: '12.x'