-
Notifications
You must be signed in to change notification settings - Fork 15
115 lines (83 loc) · 3.19 KB
/
tests.yaml
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Tests
on: [push, pull_request_target]
jobs:
tests:
name: Unit Tests
runs-on: ubuntu-latest
if: >
github.event_name == 'push' ||
github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository
steps:
- uses: actions/checkout@v4
with:
# Disabling shallow clone is recommended for improving relevancy of reporting for sonarcloud
fetch-depth: 0
- uses: actions/setup-node@v4
- run: npm update
- run: npm install --no-audit
- run: npm run audit
- run: npm run test
- name: Fix code coverage paths
run: sed -i 's/\/home\/runner\/work\/yoti-node-sdk\/yoti-node-sdk\//\/github\/workspace\//g' ./coverage/lcov.info
- uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
examples:
name: Lint Examples
runs-on: ubuntu-latest
if: >
github.event_name == 'push' ||
github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '14'
- run: npm install
- run: npm update
- name: print versions
run: echo npm $(npm -v), node $(node -v)
- run: pushd ./examples/aml-check && npm install && npm update && npm run lint && popd
- run: pushd ./examples/idv && npm install && npm update && npm run lint && popd
- run: pushd ./examples/idv-identity-checks && npm install && npm update && npm run lint && popd
- run: pushd ./examples/profile && npm install && npm update && npm run lint && popd
- run: pushd ./examples/profile-identity-checks && npm install && npm update && npm run lint && popd
node-compatibility:
name: Node ${{ matrix.node-version }}
runs-on: ubuntu-latest
# always run on push events
# only run on pull_request_target event when pull request pulls from fork repository
if: >
github.event_name == 'push' ||
github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository
strategy:
fail-fast: false
matrix:
node-version: [14, 16, 18, 20]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm update
- run: npm run test
os-compatibility:
name: Running in ${{ matrix.os }}
runs-on: ${{ matrix.os }}
# always run on push events
# only run on pull_request_target event when pull request pulls from fork repository
if: >
github.event_name == 'push' ||
github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm install
- run: npm update
- run: npm run test