1+ name : CI Build
2+
3+ on :
4+ push :
5+ branches : [ master ]
6+ pull_request :
7+ branches : [ master ]
8+
9+ jobs :
10+ build :
11+ name : Build and Test
12+ runs-on : ubuntu-latest
13+ permissions :
14+ contents : read
15+
16+ strategy :
17+ matrix :
18+ java : ['8', '11', '17', '21']
19+
20+ steps :
21+ - name : Checkout code
22+ uses : actions/checkout@v4
23+
24+ - name : Set up JDK ${{ matrix.java }}
25+ uses : actions/setup-java@v4
26+ with :
27+ java-version : ${{ matrix.java }}
28+ distribution : ' temurin'
29+ cache : ' maven'
30+
31+ - name : Build with Maven
32+ run : mvn -B clean compile --file pom.xml
33+
34+ - name : Run tests
35+ run : mvn -B test --file pom.xml
36+
37+ - name : Generate test report
38+ if : always()
39+ run : mvn surefire-report:report-only
40+
41+ - name : Upload test results
42+ if : always()
43+ uses : actions/upload-artifact@v4
44+ with :
45+ name : test-results-java-${{ matrix.java }}
46+ path : target/surefire-reports/
47+ retention-days : 7
48+
49+ - name : Upload coverage report
50+ if : matrix.java == '8'
51+ uses : actions/upload-artifact@v4
52+ with :
53+ name : coverage-report
54+ path : target/site/jacoco/
55+ retention-days : 30
56+
57+ quality :
58+ name : Code Quality Checks
59+ runs-on : ubuntu-latest
60+ permissions :
61+ contents : read
62+
63+ steps :
64+ - name : Checkout code
65+ uses : actions/checkout@v4
66+
67+ - name : Set up JDK 8
68+ uses : actions/setup-java@v4
69+ with :
70+ java-version : ' 8'
71+ distribution : ' temurin'
72+ cache : ' maven'
73+
74+ - name : Compile code
75+ run : mvn -B clean compile --file pom.xml
76+
77+ - name : Run Checkstyle
78+ run : mvn checkstyle:checkstyle --file pom.xml
79+ continue-on-error : true
80+
81+ - name : Upload Checkstyle report
82+ uses : actions/upload-artifact@v4
83+ with :
84+ name : checkstyle-report
85+ path : target/checkstyle-result.xml
86+ retention-days : 7
87+
88+ - name : Run SpotBugs
89+ run : mvn spotbugs:spotbugs --file pom.xml
90+ continue-on-error : true
91+
92+ - name : Upload SpotBugs report
93+ uses : actions/upload-artifact@v4
94+ with :
95+ name : spotbugs-report
96+ path : target/spotbugsXml.xml
97+ retention-days : 7
98+
99+ - name : Run PMD
100+ run : mvn pmd:pmd --file pom.xml
101+ continue-on-error : true
102+
103+ - name : Upload PMD report
104+ uses : actions/upload-artifact@v4
105+ with :
106+ name : pmd-report
107+ path : target/pmd.xml
108+ retention-days : 7
0 commit comments