Skip to content

Commit 2245fbe

Browse files
authored
Merge pull request #50 from mathworks/dklilley.test-automation
Create test action
2 parents eb825e1 + 4b155c9 commit 2245fbe

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/test.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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: Build and Test
5+
6+
on:
7+
# Triggers the workflow on push events for the "main" branch
8+
push:
9+
branches: [ "main" ]
10+
11+
# Triggers the workflow on pull requests for the "main" branch
12+
pull_request:
13+
branches: [ "main" ]
14+
15+
# Allows you to run this workflow manually from the Actions tab
16+
workflow_dispatch:
17+
18+
jobs:
19+
build-and-test:
20+
name: ${{ matrix.os }}-${{ matrix.node-version }}
21+
runs-on: ${{ matrix.os }}
22+
23+
strategy:
24+
matrix:
25+
node-version: [18.x, 20.x, 22.x]
26+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
27+
os: [windows-latest, ubuntu-latest, macos-13]
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
- name: Use Node.js ${{ matrix.node-version }}
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: ${{ matrix.node-version }}
35+
cache: 'npm'
36+
- name: npm clean install
37+
run: npm ci
38+
- name: Build
39+
run: npm run compile
40+
- name: Run Unit Tests
41+
run: npm test

0 commit comments

Comments
 (0)