-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (74 loc) · 2.14 KB
/
tests.yml
File metadata and controls
94 lines (74 loc) · 2.14 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
security:
runs-on: ubuntu-22.04
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
steps:
- name: Using branch ${{ github.ref }} for repository ${{ github.repository }}.
uses: actions/checkout@v6
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
node-version: 22.x
- name: Install dependencies
uses: ./.github/actions/install-dependencies
with:
node-version: 22.x
- name: Require Snyk token
if: env.SNYK_TOKEN == '' && github.event_name != 'pull_request'
run: |
echo "SNYK_TOKEN is required for Snyk dependency scan"
exit 1
- name: Run Snyk dependency scan
if: env.SNYK_TOKEN != ''
uses: snyk/actions/node@master
with:
command: test
args: --severity-threshold=high
eslint:
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [ 20.x, 22.x ]
steps:
- name: Using branch ${{ github.ref }} for repository ${{ github.repository }}.
uses: actions/checkout@v6
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
uses: ./.github/actions/install-dependencies
with:
node-version: ${{ matrix.node-version }}
- name: Run eslint
run: |
yarn eslint
tests:
needs: eslint
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [ 20.x, 22.x ]
steps:
- name: Using branch ${{ github.ref }} for repository ${{ github.repository }}.
uses: actions/checkout@v6
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
uses: ./.github/actions/install-dependencies
with:
node-version: ${{ matrix.node-version }}
- name: Run tests
uses: ./.github/actions/test
with:
artifact-name: coverage-${{ matrix.node-version }}
codecov-token: ${{ secrets.CODECOV_TOKEN }}