Skip to content

Commit 1765c2a

Browse files
committed
Add test workflow
1 parent 5bcb822 commit 1765c2a

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/tests.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Test
2+
on:
3+
- pull_request
4+
- push
5+
6+
jobs:
7+
test:
8+
name: Build and Run Tests
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout Code
12+
uses: actions/checkout@v3
13+
- name: Set up JDK 21
14+
uses: actions/setup-java@v3
15+
with:
16+
java-version: 21
17+
distribution: temurin
18+
- name: Setup gradle
19+
uses: gradle/actions/setup-gradle@v3
20+
- name: Run tests
21+
run: ./gradlew check
22+
- name: Upload Test Report
23+
uses: actions/upload-artifact@v3
24+
if: always() # always run even if the previous step fails
25+
with:
26+
name: junit-test-results
27+
path: '**/build/test-results/test/TEST-*.xml'
28+
fail_on_failure: true
29+
retention-days: 1
30+
---
31+
name: report
32+
on:
33+
workflow_run:
34+
workflows: [test]
35+
types: [completed]
36+
37+
permissions:
38+
checks: write
39+
40+
jobs:
41+
checks:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Download Test Report
45+
uses: dawidd6/action-download-artifact@v2
46+
with:
47+
name: junit-test-results
48+
workflow: ${{ github.event.workflow.id }}
49+
run_id: ${{ github.event.workflow_run.id }}
50+
- name: Publish Test Report
51+
uses: mikepenz/action-junit-report@v3
52+
with:
53+
commit: ${{github.event.workflow_run.head_sha}}
54+
report_paths: '**/build/test-results/test/TEST-*.xml'

0 commit comments

Comments
 (0)