Skip to content

Commit 69a871b

Browse files
Add java-ci workflow for github actions
Updated the Java CI workflow to use JDK 21 and added steps for testing and coverage reporting.
1 parent 62750d0 commit 69a871b

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/maven.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Java CI with Maven
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up JDK 21 (Amazon Corretto)
17+
uses: actions/setup-java@v4
18+
with:
19+
distribution: 'corretto'
20+
java-version: '21'
21+
cache: maven
22+
23+
- name: Verify Java
24+
run: |
25+
java -version
26+
mvn -version
27+
28+
- name: Build and run tests
29+
run: mvn -B clean package -DexcludedGroups=circle-ci-ignore
30+
31+
- name: Upload JaCoCo HTML report
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: jacoco-report
35+
path: target/site/jacoco-aggregate/
36+
37+
- name: Upload coverage to Codecov
38+
uses: codecov/codecov-action@v6
39+
with:
40+
files: ./target/site/jacoco-aggregate/jacoco.xml
41+
fail_ci_if_error: true
42+
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)