-
Notifications
You must be signed in to change notification settings - Fork 4
64 lines (55 loc) · 1.88 KB
/
java-tests.yaml
File metadata and controls
64 lines (55 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Java Tests
on:
schedule:
- cron: 0 */6 * * *
pull_request: {}
jobs:
java_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
cache: maven
- name: Run tests with Gradle
if: ${{ always() }}
run: gradle test --project-dir java/gradle
continue-on-error: true
- name: Run playwright tests with Maven
if: ${{ always() }}
run: mvn test --file java/playwright/pom.xml --quiet
continue-on-error: true
- name: Run tests with Maven
id: run_tests
if: ${{ always() }}
run: mvn test --file java/maven/pom.xml --quiet
continue-on-error: true
- name: Process test results
# Run this step even if the test step ahead fails
if: ${{ always() }}
uses: trunk-io/analytics-uploader@main
env:
TRUNK_PUBLIC_API_ADDRESS: ${{ vars.TRUNK_API_ENDPOINT }}
with:
# Path to your test results.
junit-paths:
"**/gradle/**/test-results/**/*.xml,**/surefire-reports/*.xml,**/playwright/**/surefire-reports/*.xml"
# Provide your Trunk organization slug.
org-slug: ${{ vars.ORG_SLUG }}
# Provide your Trunk API token as a GitHub secret.
token: ${{ secrets.TRUNK_TOKEN }}
# Pass the test outcome for quarantining support
previous-step-outcome: ${{ steps.run_tests.outcome }}
- name: Upload JUnit XML artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: java-junit-results
path: |
**/gradle/**/test-results/**/*.xml
**/surefire-reports/*.xml
**/playwright/**/surefire-reports/*.xml
retention-days: 7