-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (47 loc) · 1.24 KB
/
js-tests.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
name: JavaScript Tests
on:
push:
branches:
- 'main'
paths:
- '**.js'
- '**.json'
pull_request:
branches:
- '**'
paths:
- '**.js'
- '**.json'
jobs:
build:
name: Test the Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v1
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Echo Node & NPM versions
run: |
node -v
npm -v
- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
echo "::set-output name=npm-version::$(npm -v)"
echo "::set-output name=node-version::$(node-v)"
- name: Cache Dependencies
id: npm-cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-npm-${{ steps.npm-cache-dir.outputs.node-version }}-${{ steps.npm-cache-dir.outputs.npm-version }}-${{ hashFiles('package-lock.json') }}
- name: Install Dependencies
run: npm ci
- name: Run the build
run: |
npm run eslint
npm test
npm run build