Skip to content

Commit b3d7aa3

Browse files
chore: add test action
1 parent 221763b commit b3d7aa3

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/tests

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3+
4+
name: npm test
5+
6+
on:
7+
workflow_dispatch:
8+
push:
9+
branches: [ "main" ]
10+
pull_request:
11+
branches: [ "main" ]
12+
13+
jobs:
14+
build:
15+
16+
timeout-minutes: 5
17+
18+
strategy:
19+
matrix:
20+
os: [ubuntu-24.04]
21+
node-version: [20.x, 22.x]
22+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
23+
24+
runs-on: ${{ matrix.os }}
25+
26+
steps:
27+
- uses: actions/checkout@v3
28+
- name: Use Node.js ${{ matrix.node-version }}
29+
uses: actions/setup-node@v3
30+
with:
31+
node-version: ${{ matrix.node-version }}
32+
cache: 'npm'
33+
- name: Install dependencies
34+
run: npm ci
35+
- run: npm run build --if-present
36+
- name: Run tests on ${{ matrix.os }} node ${{ matrix.node-version }}
37+
run: npm test

0 commit comments

Comments
 (0)