File tree 2 files changed +57
-16
lines changed
2 files changed +57
-16
lines changed Original file line number Diff line number Diff line change 1
1
name : Java CI
2
2
3
- on : [push]
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ - sdk-automation/models
8
+ - promote/main
9
+ pull_request :
10
+ branches :
11
+ - main
12
+ - sdk-automation/models
13
+ - promote/main
14
+ workflow_dispatch : {}
15
+
16
+ permissions :
17
+ contents : read
4
18
5
19
jobs :
6
- build :
20
+ java-check :
21
+ runs-on : ubuntu-latest
22
+
23
+ steps :
24
+ - uses : actions/checkout@v4
25
+ - name : Set up JDK
26
+ uses : actions/setup-java@v4
27
+ with :
28
+ java-version : ' 20'
29
+ distribution : ' adopt'
30
+ - name : Cache Maven packages
31
+ uses : actions/cache@v3
32
+ with :
33
+ path : ~/.m2
34
+ key : ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
35
+ restore-keys : |
36
+ ${{ runner.os }}-m2-
37
+ - name : Check code style
38
+ run : mvn -B checkstyle:check --no-transfer-progress
39
+
40
+ java-test :
7
41
runs-on : ubuntu-latest
42
+ needs : java-check
43
+
8
44
strategy :
9
45
matrix :
10
46
java : [ '11', '17', '20' ]
47
+
11
48
steps :
12
49
- uses : actions/checkout@v4
13
- - name : Set up JDK ${{ matrix.Java }}
50
+ - name : Set up JDK ${{ matrix.java }}
14
51
uses : actions/setup-java@v4
15
-
16
52
with :
17
53
java-version : ${{ matrix.java }}
18
54
distribution : ' adopt'
19
-
20
- - name : Run the tests with Maven
21
- run : mvn -B clean test package --no-transfer-progress
55
+ - name : Cache Maven packages
56
+ uses : actions/cache@v3
57
+ with :
58
+ path : ~/.m2
59
+ key : ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
60
+ restore-keys : |
61
+ ${{ runner.os }}-m2-
62
+ - name : Run tests with coverage
63
+ run : mvn -B clean test package --no-transfer-progress
Original file line number Diff line number Diff line change 1
1
name : Sonarcloud CI
2
2
3
3
on :
4
- push :
5
- branches :
6
- - main
7
- pull_request :
8
- types : [ opened, synchronize, reopened ]
4
+ schedule :
5
+ - cron : ' 0 0 * * 4'
6
+ workflow_dispatch : {}
7
+
8
+ permissions :
9
+ contents : read
10
+ pull-requests : read
9
11
10
12
jobs :
11
- SonarCloud-Build :
12
- name : SonarCloud Build
13
+ java-sonarqube :
13
14
runs-on : ubuntu-latest
14
15
steps :
15
16
- uses : actions/checkout@v4
40
41
run : mvn test jacoco:report
41
42
42
43
- name : Run SonarCloud Analysis
43
- if : ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
44
44
env :
45
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
46
45
SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
47
46
run : mvn sonar:sonar -Dsonar.projectKey=Adyen_adyen-java-api-library
You can’t perform that action at this time.
0 commit comments