Skip to content

Commit e7b8913

Browse files
committed
ci: split Lint and Build
1 parent 11001c0 commit e7b8913

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

.github/workflows/node.js.yml

+28-4
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ on:
66
push:
77
branches: [ master ]
88
jobs:
9-
build:
10-
name: Lint & Test
9+
test:
10+
name: Test
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
@@ -35,7 +35,31 @@ jobs:
3535
${{ runner.os }}-yarn-
3636
- run: yarn
3737
name: Install dependencies...
38-
- name: Lint
39-
run: yarn lint
4038
- name: Test
4139
run: yarn test
40+
lint:
41+
name: Lint
42+
runs-on: ubuntu-latest
43+
strategy:
44+
matrix:
45+
node-version: [14.x]
46+
steps:
47+
- uses: actions/checkout@v2
48+
- name: Use Node.js ${{ matrix.node-version }}
49+
uses: actions/setup-node@v1
50+
with:
51+
node-version: ${{ matrix.node-version }}
52+
- name: Get yarn cache directory path
53+
id: yarn-cache-dir-path
54+
run: echo "::set-output name=dir::$(yarn cache dir)"
55+
- uses: actions/cache@v2
56+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
57+
with:
58+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
59+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
60+
restore-keys: |
61+
${{ runner.os }}-yarn-
62+
- run: yarn
63+
name: Install dependencies...
64+
- name: Lint
65+
run: yarn lint

0 commit comments

Comments
 (0)