Skip to content

Commit 147476c

Browse files
committed
Added test workflow to run unit tests
Add names to workflow steps Change workflow triggers Ref: #28
1 parent 9e171e5 commit 147476c

3 files changed

Lines changed: 56 additions & 7 deletions

File tree

.github/workflows/build.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
name: Build
22

3-
on: [push, pull_request]
3+
on: # rebuild any PRs and main branch changes
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
- 'releases/*'
49

510
jobs:
11+
612
build:
713

814
runs-on: ubuntu-latest
@@ -19,7 +25,9 @@ jobs:
1925
with:
2026
node-version: ${{ matrix.node-version }}
2127
cache: 'npm'
22-
- run: npm clean-install
23-
- run: npm run build
28+
- name: Run npm clean-install
29+
run: npm clean-install
30+
- name: Run build
31+
run: npm run build
2432

2533

.github/workflows/lint.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
name: Lint
22

3-
on: [push, pull_request]
3+
on: # rebuild any PRs and main branch changes
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
- 'releases/*'
49

510
jobs:
6-
build:
11+
12+
lint:
713

814
runs-on: ubuntu-latest
915

@@ -19,5 +25,7 @@ jobs:
1925
with:
2026
node-version: ${{ matrix.node-version }}
2127
cache: 'npm'
22-
- run: npm clean-install
23-
- run: npm run lint
28+
- name: Run npm clean-install
29+
run: npm clean-install
30+
- name: Run linting
31+
run: npm run lint

.github/workflows/test.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Test
2+
3+
on: # rebuild any PRs and main branch changes
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
- 'releases/*'
9+
10+
jobs:
11+
12+
test:
13+
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
node-version: [12.x, 14.x, 16.x]
19+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Use Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v2
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
cache: 'npm'
28+
- name: Run npm clean-install
29+
run: npm clean-install
30+
- name: Run unit tests
31+
run: npm run test:unit:ci
32+
33+

0 commit comments

Comments
 (0)