ci(workflow): add cache to workflows using actions/setup-node (#1872)
This commit is contained in:
16
.github/workflows/tests.yml
vendored
16
.github/workflows/tests.yml
vendored
@@ -2,13 +2,12 @@ name: Node.js CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [main]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main ]
|
branches: [main]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
@@ -17,16 +16,13 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- 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 }}
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
- name: Cache .pnpm-store
|
cache: pnpm
|
||||||
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
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: pnpm i && pnpm -r test
|
run: pnpm i && pnpm -r test
|
||||||
|
|||||||
Reference in New Issue
Block a user