-
-
Notifications
You must be signed in to change notification settings - Fork 19
108 lines (88 loc) · 2.42 KB
/
ci.yml
File metadata and controls
108 lines (88 loc) · 2.42 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: CI Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
java: ['17', '21', '25']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'maven'
- name: Build with Maven
run: mvn -B clean compile --file pom.xml
- name: Run tests
run: mvn -B test --file pom.xml
- name: Generate test report
if: always()
run: mvn surefire-report:report-only
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-java-${{ matrix.java }}
path: target/surefire-reports/
retention-days: 7
- name: Upload coverage report
if: matrix.java == '8'
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: target/site/jacoco/
retention-days: 30
quality:
name: Code Quality Checks
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
- name: Compile code
run: mvn -B clean compile --file pom.xml
- name: Run Checkstyle
run: mvn checkstyle:checkstyle --file pom.xml
continue-on-error: true
- name: Upload Checkstyle report
uses: actions/upload-artifact@v4
with:
name: checkstyle-report
path: target/checkstyle-result.xml
retention-days: 7
- name: Run SpotBugs
run: mvn spotbugs:spotbugs --file pom.xml
continue-on-error: true
- name: Upload SpotBugs report
uses: actions/upload-artifact@v4
with:
name: spotbugs-report
path: target/spotbugsXml.xml
retention-days: 7
- name: Run PMD
run: mvn pmd:pmd --file pom.xml
continue-on-error: true
- name: Upload PMD report
uses: actions/upload-artifact@v4
with:
name: pmd-report
path: target/pmd.xml
retention-days: 7