-
Notifications
You must be signed in to change notification settings - Fork 5
58 lines (49 loc) · 1.59 KB
/
unit-test.yml
File metadata and controls
58 lines (49 loc) · 1.59 KB
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
name: Unit Test
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
inputs:
node-version:
description: 'Node.js version'
required: true
type: choice
default: 'all'
options:
- 'all'
- '20'
- '22'
- '24'
jobs:
unit-test:
name: Unit Test (Node.js v${{ matrix.node-version }})
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
node-version: ${{ (github.event.inputs.node-version == 'all' || github.event.inputs.node-version == '') && fromJSON('[20, 22, 24]') || fromJSON(format('[{0}]', github.event.inputs.node-version)) }}
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: ${{ matrix.node-version }}
package-manager-cache: false
- name: Install dependencies
run: npm install --ignore-scripts
- name: Build
run: npm run build || true # we currently have type errors so just ignore that
- name: Setup Harper
env:
DEFAULTS_MODE: 'dev'
HDB_ADMIN_USERNAME: 'admin'
HDB_ADMIN_PASSWORD: 'password'
ROOTPATH: '/tmp/hdb'
NODE_HOSTNAME: 'localhost'
LOGGING_LEVEL: 'info'
run: node --enable-source-maps ./dist/bin/harper.js install
- name: Run tests
run: npm run test:unit:all