-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (55 loc) · 1.6 KB
/
line_and_test.yml
File metadata and controls
59 lines (55 loc) · 1.6 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
59
name: Lint & Test
on:
workflow_dispatch: # allows manual trigger
workflow_call:
push:
branches-ignore:
- main
- beta
- alpha
jobs:
test:
name: 'Node.js v${{ matrix.node }}'
runs-on: ubuntu-latest
# skip ci if commit message contains [skip ci] preventing version bumps from triggering a new release
# if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
strategy:
matrix:
node:
- 18
- 20
- 22
steps:
- uses: actions/setup-node@v4
with:
node-version: '${{ matrix.node }}'
- uses: actions/checkout@v4
- name: 'Cache node_modules'
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-v${{ matrix.node }}-
- name: Install dependencies
run: npm ci
- name: Run Linters
run: npm run lint
- name: Run application tests
run: npm run coverage
- name: Run SEA tests
if: matrix.node == 20
run: npm run test:sea
- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage artifacts
uses: actions/upload-artifact@v4
with:
name: coverage-artifacts-node-${{ matrix.node }}
path: coverage/
- run: ls -la