Skip to content

Commit 71a90c8

Browse files
authored
Create gradle-test.yml
1 parent f4eb193 commit 71a90c8

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

.github/workflows/gradle-test.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Gradle CI
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+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up JDK 17
18+
uses: actions/setup-java@v4
19+
with:
20+
distribution: temurin
21+
java-version: 17
22+
23+
- name: Grant execute permission for gradlew
24+
run: chmod +x gradlew
25+
26+
- name: Run tests
27+
run: ./gradlew test --stacktrace
28+
29+
# Upload the test reports as artifacts
30+
- name: Upload test reports
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: junit-report
34+
path: build/test-results/test
35+
36+
# Publish test results so they appear in GitHub Actions UI
37+
- name: Publish Test Results
38+
uses: mikepenz/action-junit-report@v4
39+
if: always() # always run even if tests fail
40+
with:
41+
report_paths: '**/build/test-results/test/TEST-*.xml'

0 commit comments

Comments
 (0)