-
Notifications
You must be signed in to change notification settings - Fork 9
51 lines (47 loc) · 1.08 KB
/
test.yaml
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
---
name: Test
on:
pull_request:
branches:
- main
jobs:
testMatrix:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
java: ['11', '17']
name: "Java ${{ matrix.java }}"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '${{ matrix.java }}'
distribution: 'temurin'
cache: 'gradle'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v3
- name: Run tests
run: ./gradlew test
afterTestMatrix:
runs-on: ubuntu-latest
needs: testMatrix
if: success()
outputs:
success: ${{ steps.setoutput.outputs.success }}
steps:
- id: setoutput
run: |-
echo "::set-output name=success::true"
testSuccess:
runs-on: ubuntu-latest
needs: [testMatrix, afterTestMatrix]
if: always()
steps:
- run: |-
if [[ "${{ needs.afterTestMatrix.outputs.success}}" == "true" ]]; then
exit 0
else
exit 1
fi