-
Notifications
You must be signed in to change notification settings - Fork 4
40 lines (37 loc) · 1.23 KB
/
nodejs.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
name: Node.js CI
on:
push:
branches: [ master, vNext, '[0-9]+.[0-9]+.x' ]
pull_request:
branches: [ master, vNext, '[0-9]+.[0-9]+.x' ]
jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x]
steps:
- name: Checkout
uses: actions/checkout@v3 #set credentials for every repository on the computer --global, so `New command` CLI tests pass
- run: |
git config --global user.name github-actions
git config --global user.email [email protected]
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3 # Inbuilt cache for npm and yarn packages installation
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Install packages
run: yarn --frozen-lockfile
- name: Test
run: |
yarn config set scripts-prepend-node-path auto
yarn test
- name: Generate coverage
if: matrix.node-version == '16.x'
run: yarn coverage
- name: Publish to coveralls.io
if: matrix.node-version == '16.x'
uses: coverallsapp/[email protected]
with:
github-token: ${{ github.token }}