From 6d167ce1d677a5f6cb5022476295352f5faf3669 Mon Sep 17 00:00:00 2001 From: Oscar Dominguez Date: Sat, 16 Oct 2021 19:20:16 +0200 Subject: [PATCH] ci(workflow): add cache to workflows using actions/setup-node (#1872) --- .github/workflows/tests.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 04267c81..43517768 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,13 +2,12 @@ name: Node.js CI on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] jobs: build: - runs-on: ubuntu-latest strategy: @@ -17,16 +16,13 @@ jobs: steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + - name: Install pnpm + run: curl -f https://get.pnpm.io/v6.14.js | node - add --global pnpm@6 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} - - name: Cache .pnpm-store - uses: actions/cache@v1 - with: - path: ~/.pnpm-store - key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }} - - name: Install pnpm - run: curl -f https://get.pnpm.io/v6.14.js | node - add --global pnpm@6 + cache: pnpm - name: Run tests run: pnpm i && pnpm -r test