Skip to content

Commit dca2e1e

Browse files
committed
add test to github workflow
1 parent f1a8e0e commit dca2e1e

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/test.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build and Test
2+
3+
on:
4+
merge_group:
5+
workflow_dispatch:
6+
pull_request:
7+
types:
8+
- opened
9+
- synchronize
10+
push:
11+
branches:
12+
- master
13+
14+
permissions:
15+
contents: read
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
19+
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
strategy:
25+
matrix:
26+
node: [ 12, 14, 16, 18 ]
27+
name: Node ${{ matrix.node }} Test
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v4
31+
with:
32+
ref: ${{ github.event.pull_request.head.sha || github.ref }}
33+
34+
- name: Setup Node
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: ${{ matrix.node }}
38+
cache: 'npm'
39+
40+
- name: Install dependencies
41+
run: npm install --build-from-source
42+
43+
- name: Run Jest unit tests
44+
run: npm run test

0 commit comments

Comments
 (0)