Skip to content

Commit 4200177

Browse files
committed
build(workflow): update github action files
1 parent a00ef94 commit 4200177

File tree

3 files changed

+47
-11
lines changed

3 files changed

+47
-11
lines changed

.github/workflows/test-and-build.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Test and Build
2+
3+
on: [push]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
matrix:
11+
node-version: [14.x, 16.x]
12+
13+
steps:
14+
- uses: actions/checkout@v1
15+
- name: Use Node.js ${{ matrix.node-version }}
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: ${{ matrix.node-version }}
19+
- run: npm i
20+
- run: npm run build
21+
- run: npm test

.github/workflows/test-and-publish.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@ jobs:
1919
uses: actions/setup-node@v1
2020
with:
2121
node-version: ${{ matrix.node-version }}
22-
23-
- name: npm install and test
24-
run: |
25-
npm install
26-
npm test
22+
- run: npm i
23+
- run: npm run build
24+
- run: npm test
2725

2826
release:
27+
if: github.event.base_ref == 'refs/heads/master'
2928
runs-on: ubuntu-latest
3029
needs: test
3130
steps:

.github/workflows/vercel-deploy.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,32 @@
11
name: Deploy example on vercel
2-
on: [push]
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
38
jobs:
4-
deploy:
9+
test:
510
runs-on: ubuntu-latest
11+
12+
strategy:
13+
matrix:
14+
node-version: [14.x, 16.x]
15+
616
steps:
7-
- uses: actions/checkout@v2
8-
- uses: actions/setup-node@v1
17+
- uses: actions/checkout@v1
18+
- name: Use Node.js ${{ matrix.node-version }}
19+
uses: actions/setup-node@v1
920
with:
10-
node-version: '14'
11-
- run: npm install
21+
node-version: ${{ matrix.node-version }}
22+
- run: npm i
23+
- run: npm run build
1224
- run: npm test
1325

26+
deploy:
27+
runs-on: ubuntu-latest
28+
needs: test
29+
steps:
1430
- name: build
1531
run: |
1632
cd example

0 commit comments

Comments
 (0)