Skip to content

Commit a779c0e

Browse files
committed
Update Gradle GitHub Actions
1 parent e45a6c6 commit a779c0e

File tree

4 files changed

+27
-43
lines changed

4 files changed

+27
-43
lines changed

.github/workflows/build_test.yml

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,24 @@ jobs:
2323
distribution: 'temurin'
2424
java-version: '21'
2525

26+
- name: Setup Gradle
27+
uses: gradle/actions/setup-gradle@v3
28+
2629
- name: Build with Gradle
2730
env:
2831
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29-
uses: gradle/gradle-build-action@v3
30-
with:
31-
cache-disabled: false
32-
# Cache storage space is limited for GitHub actions
33-
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
34-
arguments: |
32+
run: >
33+
./gradlew
3534
build
3635
-x test
3736
-x spotlessCheck
3837
-x detekt
39-
38+
4039
- name: Run unit tests
4140
env:
4241
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43-
uses: gradle/gradle-build-action@v3
44-
with:
45-
cache-disabled: false
46-
# Cache storage space is limited for GitHub actions
47-
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
48-
arguments: test -x spotlessCheck
49-
42+
run: ./gradlew test -x spotlessCheck
43+
5044
update_snapshot_and_package:
5145
runs-on: ubuntu-latest
5246
if: ${{ github.ref == 'refs/heads/main' }}
@@ -69,14 +63,14 @@ jobs:
6963
with:
7064
tag_name: ${{ steps.previoustag.outputs.tag }}
7165
github_token: ${{ secrets.GITHUB_TOKEN }}
72-
66+
7367
- name: Create tag
7468
if: ${{ endsWith(steps.previoustag.outputs.tag, '-SNAPSHOT') }}
7569
uses: EndBug/latest-tag@latest
7670
with:
7771
ref: ${{ steps.previoustag.outputs.tag }}
7872
description: ${{ steps.previoustag.outputs.tag }}
79-
73+
8074
- name: Create Release
8175
if: ${{ endsWith(steps.previoustag.outputs.tag, '-SNAPSHOT') }}
8276
env:
@@ -93,14 +87,10 @@ jobs:
9387
with:
9488
distribution: 'temurin'
9589
java-version: '21'
96-
90+
91+
- name: Setup Gradle
92+
uses: gradle/actions/setup-gradle@v3
93+
9794
- name: Publish with Gradle
9895
if: ${{ endsWith(steps.previoustag.outputs.tag, '-SNAPSHOT') }}
99-
env:
100-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101-
VERSION: ${{ steps.previoustag.outputs.tag }}
102-
uses: gradle/gradle-build-action@v3
103-
with:
104-
cache-disabled: true
105-
arguments: |
106-
publish
96+
run: ./gradlew publish

.github/workflows/detekt.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,13 @@ jobs:
3030
distribution: 'temurin'
3131
java-version: '21'
3232

33+
- name: Setup Gradle
34+
uses: gradle/actions/setup-gradle@v3
35+
3336
- name: Check with Detekt
3437
env:
3538
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36-
uses: gradle/gradle-build-action@v3
37-
with:
38-
cache-disabled: false
39-
# Cache storage space is limited for GitHub actions
40-
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
41-
arguments: detekt
39+
run: ./gradlew detekt
4240

4341
- name: Upload SARIF reports to GitHub Security tab
4442
uses: github/codeql-action/upload-sarif@v3

.github/workflows/lint.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,10 @@ jobs:
2626
distribution: 'temurin'
2727
java-version: '21'
2828

29+
- name: Setup Gradle
30+
uses: gradle/actions/setup-gradle@v3
31+
2932
- name: Check with Spotless
3033
env:
3134
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32-
uses: gradle/gradle-build-action@v3
33-
with:
34-
cache-disabled: false
35-
# Cache storage space is limited for GitHub actions
36-
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
37-
arguments: spotlessCheck
38-
35+
run: ./gradlew spotlessCheck

.github/workflows/publish.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@ jobs:
2323
distribution: 'temurin'
2424
java-version: '21'
2525

26+
- name: Setup Gradle
27+
uses: gradle/actions/setup-gradle@v3
28+
2629
- name: Build with Gradle
2730
env:
2831
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29-
uses: gradle/gradle-build-action@v3
30-
with:
31-
cache-disabled: true
32-
arguments: |
33-
publish
32+
run: ./gradlew publish

0 commit comments

Comments
 (0)