1
- # # This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
2
- # # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3
- #
4
- # name: Java CI with Gradle
5
- #
6
- # on:
7
- # push:
8
- # branches: [ main ]
9
- # pull_request:
10
- # branches: "*"
11
- #
12
- # jobs:
13
- # build:
14
- # runs-on: ubuntu-latest
15
- # steps:
16
- # - uses: actions/checkout@v3
17
- # - name: Set up JDK 17
18
- # uses: actions/setup-java@v3
19
- # with:
20
- # java-version: '17'
21
- # distribution: 'adopt'
22
- # - name: Grant execute permission for gradlew
23
- # run: chmod +x gradlew
24
- # - name: Build with Gradle
25
- # run: ./gradlew build
26
- #
27
- # test:
28
- # needs: build
29
- # runs-on: ubuntu-latest
30
- # steps:
31
- # - name: Checkout repo
32
- # uses: actions/checkout@v3
33
- # - name: Set up JDK 17
34
- # uses: actions/setup-java@v3
35
- # with:
36
- # java-version: '17'
37
- # distribution: 'adopt'
38
- # - name: Grant execute permission for gradlew
39
- # run: chmod +x gradlew
40
- # - name: Build with Gradle (JDK 17)
41
- # run: ./gradlew test
42
- #
43
- # coverage:
44
- # needs: build
45
- # runs-on: ubuntu-latest
46
- # steps:
47
- # - name: Checkout repo
48
- # uses: actions/checkout@v3
49
- # - name: Set up JDK 17
50
- # uses: actions/setup-java@v3
51
- # with:
52
- # java-version: '17'
53
- # distribution: 'adopt'
54
- # - name: Grant execute permission for gradlew
55
- # run: chmod +x gradlew
56
- # - name: Run Test Coverage
57
- # run: ./gradlew jacocoTestReport
58
- # - name: Codecov
59
- # uses: codecov/codecov-action@v2.1.0
60
- # with:
61
- # files: ./build/reports/jacoco/test/jacocoTestReport.xml
62
-
63
-
64
1
# This workflow uses actions that are not certified by GitHub.
65
2
# They are provided by a third-party and are governed by
66
3
# separate terms of service, privacy policy, and support
67
4
# documentation.
68
5
69
- # name: Java CI
70
- #
71
- # on: [push]
72
-
73
- # jobs:
74
- # build:
75
- # runs-on: ubuntu-latest
76
- #
77
- # steps:
78
- # - uses: actions/checkout@v3
79
- # - name: Set up JDK 1
80
- # uses: actions/setup-java@v3
81
- # with:
82
- # java-version: '17'
83
- # distribution: 'adopt'
84
- # - name: Validate Gradle wrapper
85
- # uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
86
- # - name: Build with Gradle
87
- # uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
88
- # with:
89
- # arguments: -Pclean-release build
90
- # - name: Test with Gradle
91
- # uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
92
- # with:
93
- # arguments: test
94
- # - name: TestCoverage with Gradle
95
- # uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
96
- # with:
97
- # arguments: jacocoTestReport
98
- # - name: Codecov
99
- # uses: codecov/codecov-action@v2.1.0
100
- # with:
101
- # files: ./build/reports/jacoco/test/jacocoTestReport.xml
102
-
103
- # This workflow will build a Java project with Gradle
104
- # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
105
-
106
- name : build with gradle
6
+ name : Java CI
107
7
108
8
on :
109
9
push :
110
10
branches : [ main ]
111
11
pull_request :
112
12
branches : " *"
113
13
114
- env :
115
- # JDK version used for building jar file
116
- currentBuildVersion : 8
117
14
jobs :
118
15
build :
119
16
runs-on : ${{ matrix.operating-system }}
120
17
strategy :
121
18
matrix :
122
- operating-system : [ubuntu-latest, macOS-latest, windows-latest]
19
+ operating-system : [ ubuntu-latest, macOS-latest, windows-latest ]
123
20
# Use both LTS releases and latest one for tests
124
21
jdk : [ 11, 17, 18 ]
22
+
125
23
steps :
126
- - name : Checkout repo
127
- uses : actions/checkout@v2
128
- - name : Set up OpenJDK version ...
129
- uses : actions/setup-java@v2
24
+ - uses : actions/checkout@v3
25
+ - name : Set up JDK 1
26
+ uses : actions/setup-java@v3
130
27
with :
131
- distribution : ' zulu '
132
- java-version : ${{ matrix.jdk }}
133
- - name : Grant execute permission for gradlew
134
- run : chmod +x gradlew
28
+ java-version : ' 17 '
29
+ distribution : ' adopt '
30
+ - name : Validate Gradle wrapper
31
+ uses : gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
135
32
- name : Build with Gradle
136
- run : |
137
- if [ "$RUNNER_OS" == "Linux" ]; then
138
- ./gradlew clean build
139
- elif [ "$RUNNER_OS" == "macOS" ]; then
140
- ./gradlew clean build
141
- elif [ "$RUNNER_OS" == "Windows" ]; then
142
- ./gradlew.bat clean build
143
- else
144
- echo "$RUNNER_OS not supported"
145
- exit 1
146
- fi
147
- shell : bash
148
- coverage :
149
- needs : build
150
- runs-on : ubuntu-latest
151
- steps :
152
- - name : Checkout repo
153
- uses : actions/checkout@v2
154
- - name : Set up OpenJDK version ...
155
- uses : actions/setup-java@v2
33
+ uses : gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
34
+ with :
35
+ arguments : -Pclean-release build
36
+ - name : Test with Gradle
37
+ uses : gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
38
+ with :
39
+ arguments : test
40
+ - name : TestCoverage with Gradle
41
+ uses : gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
156
42
with :
157
- distribution : ' zulu'
158
- java-version : ${{ env.currentBuildVersion }}
159
- - name : Grant execute permission for gradlew
160
- run : chmod +x gradlew
161
- - name : Build with Gradle (JDK ${{ env.currentBuildVersion }})
162
- run : ./gradlew clean check jacocoTestReport
43
+ arguments : jacocoTestReport
163
44
- name : Codecov
164
- uses : codecov/codecov-action@v1
45
+ uses : codecov/codecov-action@v2.1.0
165
46
with :
166
47
files : ./build/reports/jacoco/test/jacocoTestReport.xml
0 commit comments