-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (52 loc) · 1.53 KB
/
build.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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Build and Test
on:
push:
branches:
- '**'
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, '[ci skip]') || github.event_name == 'workflow_dispatch' }}
strategy:
fail-fast: false
matrix:
node:
- 'current'
- 'lts/*'
- 'lts/-1'
- 'lts/-2'
knex:
- '^1.0.0'
- '^2.0.0'
name: Build and test (Node ${{ matrix.node }}, knex ${{ matrix.knex }})
steps:
- name: Harden Runner
uses: step-security/harden-runner@cba0d00b1fc9a034e1e642ea0f1103c282990604 # v2.5.0
with:
egress-policy: audit
- name: Check out the code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Set up Node.js environment
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
with:
node-version: ${{ matrix.node }}
cache: npm
- name: Update npm
run: npm i -g npm@latest
- name: Install dependencies
run: npm ci
- name: Install knex
run: npm i -D knex@${{ matrix.knex }}
- name: Install @vscode/sqlite3
run: |
npm r sqlite3
npm i -D @vscode/sqlite3
if: ${{ matrix.knex == '^1.0.0' }}
- name: Run tests
run: npm test
env:
COLLECT_COVERAGE: "0"