Skip to content

Commit 6a9b7ae

Browse files
committed
Setup CI - Unit tests
1 parent 553c9f7 commit 6a9b7ae

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

.github/workflows/nodejs.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ jobs:
1919
uses: ./.github/workflows/prepare-cache.yml
2020
with:
2121
os: ubuntu-latest
22+
prepare-npm-cache-macos:
23+
uses: ./.github/workflows/prepare-cache.yml
24+
with:
25+
os: macos-latest
26+
prepare-npm-cache-windows:
27+
uses: ./github/workflows/prepare-cache.yml
28+
with:
29+
os: windows-latest
2230

2331
lint:
2432
name: Lint
@@ -35,3 +43,19 @@ jobs:
3543
run: npm ci
3644
- name: run eslint
3745
run: npm run lint
46+
47+
test-ubuntu:
48+
uses: ./.github/workflows/test.yml
49+
needs: prepare-npm-cache-ubuntu
50+
with:
51+
os: ubuntu-latest
52+
test-macos:
53+
uses: ./.github/workflows/test.yml
54+
needs: prepare-npm-cache-macos
55+
with:
56+
os: macos-latest
57+
test-windows:
58+
uses: ./.github/workflows/test.yml
59+
needs: prepare-map-cache-windows
60+
with:
61+
os: windows-latest

.github/workflows/test.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: TEst
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
os:
7+
required: true
8+
type: string
9+
10+
jobs:
11+
test:
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
node-version: [14.x, 16.x]
16+
name: Node v${{ matrix.node-version }} on ${{ input.os }}
17+
runs-on: ${{ input.os }}
18+
19+
steps:
20+
- uses: actions/checkout@v3
21+
- name: Use Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
cache: npm
26+
- name: install
27+
run: npm ci
28+
- name: run tests
29+
run: npm run jest-ci

0 commit comments

Comments
 (0)