Skip to content

Commit 575dc19

Browse files
committed
Add CI with some unit test and lint
1 parent 258a0f5 commit 575dc19

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/build.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
path-ignore:
6+
- '**/*.md'
7+
pull_request:
8+
branches:
9+
- master
10+
path-ignore:
11+
- '**/*.md'
12+
13+
jobs:
14+
build-and-test:
15+
name: Build and Test
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
node: [10, 12]
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
- uses: actions/setup-node@v1
25+
with:
26+
node-version: ${{ matrix.node }}
27+
28+
- name: Get yarn cache directory path
29+
id: yarn-cache-dir-path
30+
run: echo "::set-output name=dir::$(yarn cache dir)"
31+
32+
- uses: actions/cache@v1
33+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
34+
with:
35+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
36+
key: ${{ runner.os }}-node${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }}
37+
restore-keys: |
38+
${{ runner.os }}-node${{ matrix.node}}-yarn-
39+
40+
- name: Install dependencies
41+
run: yarn --frozen-lockfile
42+
43+
- name: Run unit tests
44+
run: yarn test:ci:unit
45+
46+
- name: Lint
47+
run: yarn lint
48+
49+
- name: Build
50+
run: yarn build

0 commit comments

Comments
 (0)