Skip to content

Commit 12735b7

Browse files
committed
ci: Add GitHub Actions workflow for Maven tests
Add CI workflow to run Maven tests on: - Push to main branch - Pull requests targeting main branch The workflow includes: - Java 17 setup with Temurin distribution - Maven dependency caching - Test execution with mvnw - Test report generation - Upload test results as artifacts
1 parent 8c8cb65 commit 12735b7

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/maven-test.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Maven Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Set up JDK 17
20+
uses: actions/setup-java@v4
21+
with:
22+
java-version: '17'
23+
distribution: 'temurin'
24+
cache: 'maven'
25+
26+
- name: Run tests with Maven
27+
run: ./mvnw test
28+
29+
- name: Generate test report
30+
if: always()
31+
run: ./mvnw surefire-report:report
32+
33+
- name: Upload test results
34+
if: always()
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: test-results
38+
path: target/surefire-reports/

0 commit comments

Comments
 (0)