-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (72 loc) · 2 KB
/
app-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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: app-test.yaml
on:
pull_request:
branches:
- main
paths:
- src/**
- build.gradle.kts
- settings.gradle.kts
- gradle/**
permissions:
contents: read
actions: read
checks: write
jobs:
unit-tests:
name: Run Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Run Unit Tests
run: ./gradlew :test --stacktrace
- name: Unit Test Reports
uses: dorny/test-reporter@v1.9.1
if: always()
with:
name: Unit Test Reports
path: 'build/test-results/test/*.xml'
reporter: java-junit
integration-tests:
name: Run Integration Tests
needs: unit-tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download setup-envtest
uses: robinraju/release-downloader@v1.11
with:
repository: 'kubernetes-sigs/controller-runtime'
latest: true
fileName: 'setup-envtest-linux-amd64'
- name: Setup kube test API
run: |
chmod +x setup-envtest-linux-amd64
./setup-envtest-linux-amd64 use --bin-dir ~/.kubeapitest
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Run Integration Tests
env:
KUBE_API_TEST_OFFLINE_MODE: true
run: ./gradlew :integrationTest --stacktrace
- name: Integration Test Reports
uses: dorny/test-reporter@v1.9.1
if: always()
with:
name: Integration Test Reports
path: 'build/test-results/integrationTest/*.xml'
reporter: java-junit