Skip to content

Commit f24338e

Browse files
committed
gradle update, workflows refresh
1 parent cba2904 commit f24338e

File tree

7 files changed

+220
-171
lines changed

7 files changed

+220
-171
lines changed

.github/workflows/build.yml

+13-25
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Build
2-
on: [push, pull_request]
2+
on:
3+
push:
4+
branches: [ main ]
5+
pull_request:
6+
workflow_dispatch:
37
permissions:
48
contents: write
59
pull-requests: write
@@ -8,33 +12,17 @@ jobs:
812
runs-on: ubuntu-latest
913
steps:
1014
- 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
1416
with:
15-
java-version: 11
17+
java-version: 21
1618
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
3624
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:
3826
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
3927
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4028
dependabot:

.github/workflows/publish.yml

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
11
name: Publish
2-
32
on:
43
release:
54
types: [ created ]
6-
75
jobs:
86
publish:
9-
107
runs-on: ubuntu-latest
11-
128
steps:
139
- uses: actions/checkout@v4
10+
- uses: actions/setup-java@v4
1411
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
2113
distribution: temurin
14+
- uses: gradle/actions/setup-gradle@v4
2215
- name: Publish to maven central
2316
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
2417
env:

build.gradle.kts

+4-10
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ java {
2525
withSourcesJar()
2626
withJavadocJar()
2727
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
2931
}
3032
}
3133

@@ -44,17 +46,9 @@ tasks.withType<Test> {
4446
}
4547
}
4648

47-
jacoco {
48-
toolVersion = "0.8.6"
49-
reportsDir = file("$buildDir/reports/jacoco")
50-
}
51-
5249
tasks.jacocoTestReport {
5350
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
5852
}
5953
}
6054

gradle/wrapper/gradle-wrapper.jar

-15.3 KB
Binary file not shown.
+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
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
46
zipStoreBase=GRADLE_USER_HOME
57
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)