File tree 7 files changed +220
-171
lines changed
7 files changed +220
-171
lines changed Original file line number Diff line number Diff line change 1
1
name : Build
2
- on : [push, pull_request]
2
+ on :
3
+ push :
4
+ branches : [ main ]
5
+ pull_request :
6
+ workflow_dispatch :
3
7
permissions :
4
8
contents : write
5
9
pull-requests : write
8
12
runs-on : ubuntu-latest
9
13
steps :
10
14
- uses : actions/checkout@v4
11
- - uses : gradle/wrapper-validation-action@v3
12
- - name : Set up JDK 11
13
- uses : actions/setup-java@v4
15
+ - uses : actions/setup-java@v4
14
16
with :
15
- java-version : 11
17
+ java-version : 21
16
18
distribution : temurin
17
- - name : Grant execute permission for gradlew
18
- run : chmod +x gradlew
19
- - name : Cache Gradle packages
20
- uses : actions/cache@v4
21
- with :
22
- path : |
23
- ~/.gradle/caches
24
- ~/.gradle/wrapper
25
- key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
26
- restore-keys : |
27
- ${{ runner.os }}-gradle-
28
- - name : Test with Gradle
29
- run : ./gradlew --no-daemon --continue check javadoc
30
- - name : Jacoco
31
- run : ./gradlew jacocoTestReport
32
- - name : Upload coverage to Codecov
33
- uses : codecov/codecov-action@v4
34
- - name : Analyze with SonarCloud
35
- if : github.ref == 'refs/heads/main'
19
+ - uses : gradle/actions/setup-gradle@v4
20
+ - run : ./gradlew build
21
+ - run : ./gradlew jacocoTestReport
22
+ - uses : codecov/codecov-action@v4
23
+ - if : github.ref_name == github.event.repository.default_branch
36
24
run : ./gradlew sonarqube -Dsonar.login=${SONAR_TOKEN} -Dsonar.projectKey=bgalek_safe-svg -Dsonar.organization=bgalek-github -Dsonar.host.url=https://sonarcloud.io
37
- env :
25
+ env :
38
26
SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
39
27
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
40
28
dependabot :
Original file line number Diff line number Diff line change 1
1
name : Publish
2
-
3
2
on :
4
3
release :
5
4
types : [ created ]
6
-
7
5
jobs :
8
6
publish :
9
-
10
7
runs-on : ubuntu-latest
11
-
12
8
steps :
13
9
- uses : actions/checkout@v4
10
+ - uses : actions/setup-java@v4
14
11
with :
15
- fetch-depth : 0
16
- - uses : gradle/wrapper-validation-action@v3
17
- - name : Set up JDK 11
18
- uses : actions/setup-java@v4
19
- with :
20
- java-version : 11
12
+ java-version : 21
21
13
distribution : temurin
14
+ - uses : gradle/actions/setup-gradle@v4
22
15
- name : Publish to maven central
23
16
run : ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
24
17
env :
Original file line number Diff line number Diff line change 25
25
withSourcesJar()
26
26
withJavadocJar()
27
27
toolchain {
28
- languageVersion.set(JavaLanguageVersion .of(8 ))
28
+ languageVersion.set(JavaLanguageVersion .of(21 ))
29
+ sourceCompatibility = JavaVersion .VERSION_1_8
30
+ targetCompatibility = JavaVersion .VERSION_1_8
29
31
}
30
32
}
31
33
@@ -44,17 +46,9 @@ tasks.withType<Test> {
44
46
}
45
47
}
46
48
47
- jacoco {
48
- toolVersion = " 0.8.6"
49
- reportsDir = file(" $buildDir /reports/jacoco" )
50
- }
51
-
52
49
tasks.jacocoTestReport {
53
50
reports {
54
- xml.isEnabled = true
55
- xml.destination = file(" $buildDir /reports/jacoco/report.xml" )
56
- csv.isEnabled = false
57
- html.isEnabled = false
51
+ xml.required = true
58
52
}
59
53
}
60
54
Original file line number Diff line number Diff line change 1
1
distributionBase =GRADLE_USER_HOME
2
2
distributionPath =wrapper/dists
3
- distributionUrl =https\://services.gradle.org/distributions/gradle-7.6-bin.zip
3
+ distributionUrl =https\://services.gradle.org/distributions/gradle-8.10-bin.zip
4
+ networkTimeout =10000
5
+ validateDistributionUrl =true
4
6
zipStoreBase =GRADLE_USER_HOME
5
7
zipStorePath =wrapper/dists
You can’t perform that action at this time.
0 commit comments