-
Notifications
You must be signed in to change notification settings - Fork 8
65 lines (61 loc) · 1.86 KB
/
eumserver_test.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
63
64
65
name: EUM Server Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
paths-ignore:
- 'README.md'
workflow_call:
env:
NVD_API_TOKEN: ${{ secrets.NVD_API_KEY }} # Token to access NVD API for dependency-check
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
container: openjdk:17-jdk-slim
steps:
- uses: actions/checkout@v3
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: test
run: ./gradlew test
dependency-scan:
name: Dependency Scan
runs-on: ubuntu-latest
container: openjdk:17-jdk-slim
steps:
- uses: actions/checkout@v3
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: build
run: ./gradlew assemble
# the action has not been updated a while, but it always uses the latest plugin version
- name: Run DependencyCheck plugin
uses: dependency-check/Dependency-Check_Action@main
id: depcheck
continue-on-error: true # we still want to upload the report
with:
project: ${{ github.repository }}
path: '.'
format: 'HTML'
out: 'reports'
args: >
--failOnCVSS 6
--suppression dependencyCheckSuppression.xml
--disableAssembly
--nvdApiKey ${{ secrets.NVD_API_KEY }}
--nvdApiDelay 10000
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: dependency-check-report-eum-server
path: ${{ github.workspace }}/reports
# if DependencyCheck failed, the job should also fail, but only after the results were uploaded
- name: Validate DependencyCheck outcome
if: ${{ steps.depcheck.outcome == 'failure' }}
run: |
echo "DependencyCheck failed"
exit 1