-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (108 loc) · 3.01 KB
/
ci.yml
File metadata and controls
131 lines (108 loc) · 3.01 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: CI
on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master, develop ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ '21' ]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B compile -DskipTests
- name: Run unit tests
run: mvn -B test
- name: Run integration tests
run: mvn -B verify -DskipUnitTests
continue-on-error: true
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-java-${{ matrix.java-version }}
path: |
**/target/surefire-reports/
**/target/failsafe-reports/
retention-days: 7
- name: Upload JaCoCo coverage reports
uses: actions/upload-artifact@v4
if: matrix.java-version == '21'
with:
name: coverage-reports
path: |
**/target/site/jacoco/
**/target/jacoco.exec
retention-days: 7
quality:
name: Code Quality
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Run Checkstyle
run: mvn -B checkstyle:check
continue-on-error: true
- name: Run SpotBugs
run: mvn -B spotbugs:check
continue-on-error: true
- name: Run PMD
run: mvn -B pmd:check pmd:cpd-check
continue-on-error: true
- name: Upload quality reports
uses: actions/upload-artifact@v4
if: always()
with:
name: quality-reports
path: |
**/target/checkstyle-result.xml
**/target/spotbugsXml.xml
**/target/pmd.xml
**/target/cpd.xml
retention-days: 7
package:
name: Package
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Package artifacts
run: mvn -B package -DskipTests
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: maven-artifacts
path: |
**/target/*.jar
!**/target/*-sources.jar
!**/target/*-javadoc.jar
retention-days: 30