File tree 3 files changed +53
-56
lines changed
3 files changed +53
-56
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ name: Java CI with Gradle
2
2
on :
3
3
push :
4
4
branches : [ master ]
5
+ pull_request :
6
+ branches : [ master ]
5
7
workflow_dispatch :
6
8
7
9
jobs :
@@ -11,40 +13,12 @@ jobs:
11
13
steps :
12
14
- uses : actions/checkout@v4
13
15
14
- - name : Set up JDK
16
+ - name : Set up JDK 21
15
17
uses : actions/setup-java@v4
16
18
with :
17
- distribution : ' temurin'
18
- java-version : ' 21'
19
- cache : ' gradle'
20
-
21
- - name : Grant execute permission for gradlew
22
- run : chmod +x gradlew
19
+ distribution : temurin
20
+ java-version : 21
21
+ cache : gradle
23
22
24
23
- name : Build with Gradle
25
24
run : ./gradlew githubWorkflowTest --no-daemon -i
26
-
27
- - name : Run Test Coverage
28
- run : ./gradlew jacocoTestReport -i -PexecutionData='/home/runner/work/java-interview-coding/java-interview-coding/build/jacoco/jacocoTest.exec'
29
-
30
- - name : Generate JaCoCo Badge
31
- uses : cicirello/jacoco-badge-generator@v2
32
- with :
33
- generate-branches-badge : true
34
- jacoco-csv-file : build/reports/jacoco/test/jacocoTestReport.csv
35
-
36
- - name : Commit the badge (if it changed)
37
- run : |
38
- if [[ `git status --porcelain` ]]; then
39
- git config --global user.name 'Github workflow'
40
- git config --global user.email 'nowhere@gmail.com'
41
- git add -A
42
- git commit -m "Autogenerated JaCoCo coverage badge"
43
- git push
44
- fi
45
-
46
- - name : Upload JaCoCo coverage report
47
- uses : actions/upload-artifact@v4
48
- with :
49
- name : jacoco-report
50
- path : build/jacocoHtml/
Original file line number Diff line number Diff line change
1
+ name : Java CI with Gradle
2
+ on :
3
+ push :
4
+ branches : [ master ]
5
+ workflow_dispatch :
6
+
7
+ jobs :
8
+ build :
9
+ runs-on : ubuntu-latest
10
+
11
+ steps :
12
+ - uses : actions/checkout@v4
13
+
14
+ - name : Set up JDK 21
15
+ uses : actions/setup-java@v4
16
+ with :
17
+ distribution : temurin
18
+ java-version : 21
19
+ cache : gradle
20
+
21
+ - name : Build with Gradle
22
+ run : ./gradlew githubWorkflowTest --no-daemon -i
23
+
24
+ - name : Run Test Coverage
25
+ run : ./gradlew jacocoTestReport -i -PexecutionData='/home/runner/work/java-interview-coding/java-interview-coding/build/jacoco/jacocoTest.exec'
26
+
27
+ - name : Generate JaCoCo Badge
28
+ uses : cicirello/jacoco-badge-generator@v2
29
+ with :
30
+ generate-branches-badge : true
31
+ jacoco-csv-file : build/reports/jacoco/test/jacocoTestReport.csv
32
+
33
+ - name : Commit the badge (if it changed)
34
+ run : |
35
+ if [[ `git status --porcelain` ]]; then
36
+ git config --global user.name 'Github workflow'
37
+ git config --global user.email 'nowhere@gmail.com'
38
+ git add -A
39
+ git commit -m "Autogenerated JaCoCo coverage badge"
40
+ git push
41
+ fi
42
+
43
+ - name : Upload JaCoCo coverage report
44
+ uses : actions/upload-artifact@v4
45
+ with :
46
+ name : jacoco-report
47
+ path : build/jacocoHtml/
You can’t perform that action at this time.
0 commit comments