forked from deephaven/deephaven-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (55 loc) · 1.69 KB
/
test-js-packages.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
56
57
58
59
60
61
62
63
# This workflow will perform unit tests of the javascript plugins
name: Test JS Packages
on:
workflow_dispatch:
workflow_call:
jobs:
unit:
runs-on: ubuntu-22.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Cache jest
uses: actions/cache@v4
with:
path: |
.jest-cache
plugins/**/.jest-cache
key: ${{ runner.os }}-jestcache-${{ github.sha }}
restore-keys: |
${{ runner.os }}-jestcache-
- name: Cache linters
uses: actions/cache@v4
with:
path: |
.eslintcache
plugins/**/.eslintcache
.stylelintcache
plugins/**/.stylelintcache
key: ${{ runner.os }}-lintcache-${{ github.sha }}
restore-keys: |
${{ runner.os }}-lintcache-
- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v4
with:
save-always: true
path: |
node_modules
plugins/**/node_modules
key: unit-node-modules-${{ hashFiles('package-lock.json')}}
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci --no-audit
# Run all tests for all the packages
# Caching with the absolute path b/c Jest will make a folder in each project
# Then there's caches in all plugin folders
- name: Run Tests
run: npm run test:ci