-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (112 loc) · 3.09 KB
/
check.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
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: Check code on pull requests & subsequent pushes
on:
pull_request:
branches:
- trunk
push:
branches:
- trunk
env:
GITHUB_USERNAME: AntonOellerer
jobs:
owasp:
name: owasp
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/[email protected]
with:
java-version: 17
distribution: 'zulu'
- name: Run owasp dependency check
uses: gradle/gradle-build-action@v2
with:
arguments: dependencyCheckAnalyze
- name: Archive owasp check results
uses: actions/upload-artifact@v3
if: always()
with:
name: owasp-results
path: build/reports/dependency-check-report.html
retention-days: 5
checkstyle:
name: checkstyle
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/[email protected]
with:
java-version: 17
distribution: 'zulu'
- name: Run checkstyle
uses: gradle/gradle-build-action@v2
with:
arguments: checkMain checkTest
- name: Archive checkstyle results
uses: actions/upload-artifact@v3
if: always()
with:
name: checkstyle-results
path: build/reports/checkstyle.html
retention-days: 5
tests:
name: tests
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/[email protected]
with:
java-version: 17
distribution: 'zulu'
- name: Run tests
uses: gradle/gradle-build-action@v2
with:
arguments: test
- name: Archive test results
uses: actions/upload-artifact@v3
if: always()
with:
name: test-results
path: build/reports/tests/test
retention-days: 5
sonarcloud:
name: sonarcloud
runs-on: ubuntu-20.04
if: ${{ github.actor != 'dependabot[bot]' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Setup Java
uses: actions/[email protected]
with:
java-version: 17
distribution: 'zulu'
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Run sonarqube check
uses: gradle/gradle-build-action@v2
with:
arguments: build sonarqube --info
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any