From e1c51d766f842df28bfac1a321c50d7f3808ea61 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Mon, 17 Feb 2020 15:18:16 +0100 Subject: [PATCH] Add yarn cache (#53) --- .github/workflows/pr-any.yml | 30 ++++++++++++++++++++++++++++++ .github/workflows/push-master.yml | 10 ++++++++++ jest.resolver.js | 4 ++-- 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-any.yml b/.github/workflows/pr-any.yml index f3d7e239..a2a3f373 100644 --- a/.github/workflows/pr-any.yml +++ b/.github/workflows/pr-any.yml @@ -14,6 +14,16 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} + - name: Config yarn cache + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v1 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - name: lint run: | yarn install --frozen-lockfile @@ -31,6 +41,16 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} + - name: Config yarn cache + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v1 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - name: test run: | rustup toolchain install nightly @@ -49,6 +69,16 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} + - name: Config yarn cache + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v1 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - name: build run: | rustup toolchain install nightly diff --git a/.github/workflows/push-master.yml b/.github/workflows/push-master.yml index 1e0305dd..5aef8bd5 100644 --- a/.github/workflows/push-master.yml +++ b/.github/workflows/push-master.yml @@ -20,6 +20,16 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} + - name: Config yarn cache + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v1 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - name: build env: CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} diff --git a/jest.resolver.js b/jest.resolver.js index b3ee74e4..ba45e549 100644 --- a/jest.resolver.js +++ b/jest.resolver.js @@ -1,8 +1,8 @@ -// Copyright 2017-2020 @polkadot/util authors & contributors +// Copyright 2019-2020 @polkadot/wasm-crypto authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +/* eslint-disable @typescript-eslint/no-var-requires */ -// eslint-disable-next-line @typescript-eslint/no-var-requires const path = require('path'); module.exports = function resolver (file, config) {