Repository navigation
58 lines (53 loc) · 1.6 KB
/
Copy pathtest.yaml
File metadata and controls
58 lines (53 loc) · 1.6 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
---
name: Test
on:
pull_request:
branches:
- main
defaults:
run:
shell: bash
permissions: {}
jobs:
testMatrix:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
max-parallel: 1
matrix:
java: ["17", "21", "25"]
name: "Java ${{ matrix.java }}"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
with:
java-version: "${{ matrix.java }}"
distribution: "temurin"
cache: "gradle"
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
- name: Run tests
run: ./gradlew test
env:
CERBOS_HUB_API_ENDPOINT: "${{ secrets.CERBOS_HUB_API_ENDPOINT }}"
CERBOS_HUB_CLIENT_ID: "${{ secrets.CERBOS_HUB_CLIENT_ID }}"
CERBOS_HUB_CLIENT_SECRET: "${{ secrets.CERBOS_HUB_CLIENT_SECRET }}"
CERBOS_HUB_STORE_ID: "${{ secrets.CERBOS_HUB_STORE_ID }}"
- name: Store reports
if: failure()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: "Reports for Java ${{ matrix.java }}"
path: |-
**/build/reports/
**/build/test-results/
testSuccess:
runs-on: ubuntu-latest
needs: testMatrix
if: always()
steps:
- name: Check test results
run: test "${{ needs.testMatrix.result }}" = "success"