-
Notifications
You must be signed in to change notification settings - Fork 25
55 lines (49 loc) · 1.77 KB
/
node.js.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#*********************************************************************
# Copyright (c) Intel Corporation 2020
# SPDX-License-Identifier: Apache-2.0
#*********************************************************************/
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run lint
if: ${{ matrix.node-version == '16.x' }}
- run: npm run compile --if-present
- run: npm test
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
continue-on-error: true
with:
name: JEST Tests # Name of the check run which will be created
path: junit.xml # Path to test results
reporter: jest-junit # Format of test results
fail-on-error: 'false'
- uses: codecov/codecov-action@894ff025c7b54547a9a2a1e9f228beae737ad3c2 # v3.1.3
name: Upload Coverage Results
if: ${{ matrix.node-version == '16.x' }}
- name: Rename test file
run: mv junit.xml mps-unit.xml
- name: Upload JEST Results
uses: actions/upload-artifact@v3
with:
name: mps-unit
path: mps-unit.xml