Skip to content

Commit c0537f2

Browse files
committed
ci: introduce multi-jdk build matrix (8, 11, 17, 21)
- Configured GitHub Actions strategy matrix to validate cross-version compatibility. - Isolated Jacoco coverage badge generation to the JDK 17 job to prevent git race conditions.
1 parent fa48bc2 commit c0537f2

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,19 @@ permissions:
1212
jobs:
1313
build:
1414
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
java: [ '8', '11', '17', '21' ]
1519

1620
steps:
1721
- name: Checkout code
1822
uses: actions/checkout@v6
1923

20-
- name: Set up JDK 17
24+
- name: Set up JDK ${{ matrix.java }}
2125
uses: actions/setup-java@v5
2226
with:
23-
java-version: '17'
27+
java-version: ${{ matrix.java }}
2428
distribution: 'temurin'
2529
cache: gradle
2630

@@ -31,14 +35,15 @@ jobs:
3135
run: ./gradlew build jacocoTestReport
3236

3337
- name: Generate Jacoco Badge
38+
if: ${{ matrix.java == '17' }}
3439
uses: cicirello/jacoco-badge-generator@v2
3540
with:
3641
jacoco-csv-file: sift-core/build/reports/jacoco/test/jacocoTestReport.csv sift-annotations/build/reports/jacoco/test/jacocoTestReport.csv
3742
badges-directory: .github/badges
3843
generate-branches-badge: false
3944

4045
- name: Commit and Push Badge
41-
if: ${{ github.event_name == 'push' }}
46+
if: ${{ github.event_name == 'push' && matrix.java == '17' }}
4247
run: |
4348
git config --global user.name "github-actions"
4449
git config --global user.email "github-actions@github.com"

0 commit comments

Comments
 (0)