File tree Expand file tree Collapse file tree 2 files changed +14
-71
lines changed Expand file tree Collapse file tree 2 files changed +14
-71
lines changed Original file line number Diff line number Diff line change 1
- name : Push Main
1
+ name : Build
2
2
3
3
on :
4
4
push :
5
5
branches :
6
6
- ' main'
7
+ pull_request :
8
+ branches :
9
+ - ' main'
7
10
8
11
jobs :
9
12
build :
15
18
with :
16
19
fetch-depth : 0
17
20
21
+ - name : Set up JDK 21
22
+ uses : actions/setup-java@v4
23
+ with :
24
+ java-version : ' 21'
25
+ distribution : ' temurin'
26
+ cache : maven
27
+
18
28
- name : Cache SonarQube packages
19
29
uses : actions/cache@v4
20
30
with :
@@ -29,21 +39,11 @@ jobs:
29
39
key : ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
30
40
restore-keys : ${{ runner.os }}-m2
31
41
32
- - name : Set up JDK 21
33
- uses : actions/setup-java@v4
34
- with :
35
- java-version : ' 21'
36
- distribution : ' temurin'
37
- cache : maven
38
-
39
42
- name : Lint
40
43
run : mvn spotless:check
41
44
42
45
- name : Build
43
- run : mvn -B compile
44
-
45
- - name : Test
46
- run : mvn -B test
46
+ run : mvn clean package
47
47
48
48
- name : Publish test report
49
49
if : always()
@@ -52,12 +52,14 @@ jobs:
52
52
report_paths : ' **/target/surefire-reports/TEST-*.xml'
53
53
54
54
- name : Sonar
55
+ if : github.event.pull_request.head.repo.fork == false
55
56
run : mvn verify sonar:sonar
56
57
env :
57
58
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
58
59
SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
59
60
60
61
- name : Docker
62
+ if : github.ref == 'refs/heads/main'
61
63
run : mvn -B -DskipTests package jib:build -Djib.to.auth.username=$DOCKER_USER -Djib.to.auth.password=$DOCKER_TOKEN
62
64
env :
63
65
DOCKER_USER : ${{ secrets.DOCKER_USER }}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments