Skip to content

Commit 14c39f7

Browse files
committed
GH workflows clean up: formatting & minor adjustments
1 parent e885123 commit 14c39f7

File tree

2 files changed

+48
-46
lines changed

2 files changed

+48
-46
lines changed

.github/workflows/gradle.yml

+10-9
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v4
14+
- name: Checkout sources
15+
uses: actions/checkout@v4
1516

16-
- name: Set up JDK 21
17-
uses: actions/setup-java@v4
18-
with:
19-
distribution: temurin
20-
java-version: 21
21-
cache: gradle
17+
- name: Set up JDK 21
18+
uses: actions/setup-java@v4
19+
with:
20+
distribution: temurin
21+
java-version: 21
22+
cache: gradle
2223

23-
- name: Build with Gradle
24-
run: ./gradlew githubWorkflowTest --no-daemon -i
24+
- name: Build with Gradle Wrapper
25+
run: ./gradlew githubWorkflowTest --no-daemon -i

.github/workflows/test-coverage.yml

+38-37
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Calculate test coverage & update GH badges
1+
name: Test coverage
22
on:
33
workflow_dispatch:
44

@@ -7,39 +7,40 @@ jobs:
77
runs-on: ubuntu-latest
88

99
steps:
10-
- uses: actions/checkout@v4
11-
12-
- name: Set up JDK 21
13-
uses: actions/setup-java@v4
14-
with:
15-
distribution: temurin
16-
java-version: 21
17-
cache: gradle
18-
19-
- name: Build with Gradle
20-
run: ./gradlew githubWorkflowTest --no-daemon -i
21-
22-
- name: Run Test Coverage
23-
run: ./gradlew jacocoTestReport -i -PexecutionData='/home/runner/work/java-interview-coding/java-interview-coding/build/jacoco/jacocoTest.exec'
24-
25-
- name: Generate JaCoCo Badge
26-
uses: cicirello/jacoco-badge-generator@v2
27-
with:
28-
generate-branches-badge: true
29-
jacoco-csv-file: build/reports/jacoco/test/jacocoTestReport.csv
30-
31-
- name: Commit the badge (if it changed)
32-
run: |
33-
if [[ `git status --porcelain` ]]; then
34-
git config --global user.name 'Github workflow'
35-
git config --global user.email '[email protected]'
36-
git add -A
37-
git commit -m "Autogenerated JaCoCo coverage badge"
38-
git push
39-
fi
40-
41-
- name: Upload JaCoCo coverage report
42-
uses: actions/upload-artifact@v4
43-
with:
44-
name: jacoco-report
45-
path: build/jacocoHtml/
10+
- name: Checkout sources
11+
uses: actions/checkout@v4
12+
13+
- name: Set up JDK 21
14+
uses: actions/setup-java@v4
15+
with:
16+
distribution: temurin
17+
java-version: 21
18+
cache: gradle
19+
20+
- name: Build with Gradle Wrapper
21+
run: ./gradlew githubWorkflowTest --no-daemon -i
22+
23+
- name: Run Test Coverage
24+
run: ./gradlew jacocoTestReport -i -PexecutionData='/home/runner/work/java-interview-coding/java-interview-coding/build/jacoco/jacocoTest.exec'
25+
26+
- name: Generate JaCoCo Badge
27+
uses: cicirello/jacoco-badge-generator@v2
28+
with:
29+
generate-branches-badge: true
30+
jacoco-csv-file: build/reports/jacoco/test/jacocoTestReport.csv
31+
32+
- name: Commit the badge (if it changed)
33+
run: |
34+
if [[ `git status --porcelain` ]]; then
35+
git config --global user.name 'Github workflow'
36+
git config --global user.email '[email protected]'
37+
git add -A
38+
git commit -m "Autogenerated JaCoCo coverage badge"
39+
git push
40+
fi
41+
42+
- name: Upload JaCoCo coverage report
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: jacoco-report
46+
path: build/jacocoHtml/

0 commit comments

Comments
 (0)