-
Notifications
You must be signed in to change notification settings - Fork 57
142 lines (121 loc) · 5.42 KB
/
test.yml
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: 'Test Charts'
on: 'pull_request'
jobs:
test:
runs-on: 'ubuntu-latest'
permissions:
contents: 'read'
id-token: 'write'
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
k8s:
- version: v1.25
kindest-image-tag: 'v1.25.16@sha256:5da57dfc290ac3599e775e63b8b6c49c0c85d3fec771cd7d55b45fae14b38d3b'
- version: v1.26
kindest-image-tag: 'v1.26.15@sha256:84333e26cae1d70361bb7339efb568df1871419f2019c80f9a12b7e2d485fe19'
- version: v1.27
kindest-image-tag: 'v1.27.13@sha256:17439fa5b32290e3ead39ead1250dca1d822d94a10d26f1981756cd51b24b9d8'
- version: v1.28
kindest-image-tag: 'v1.28.9@sha256:dca54bc6a6079dd34699d53d7d4ffa2e853e46a20cd12d619a09207e35300bd0'
- version: v1.29
kindest-image-tag: 'v1.29.4@sha256:3abb816a5b1061fb15c6e9e60856ec40d56b7b52bcea5f5f1350bc6e2320b6f8'
- version: v1.30
kindest-image-tag: 'v1.30.0@sha256:047357ac0cfea04663786a612ba1eaba9702bef25227a794b52890dd8bcd692e'
helm-version:
- latest
include:
- k8s:
version: v1.30
kindest-image-tag: 'v1.30.0@sha256:047357ac0cfea04663786a612ba1eaba9702bef25227a794b52890dd8bcd692e'
helm-version: v3.9.0
name: 'K8s version ${{ matrix.k8s.version }} - Helm version ${{ matrix.helm-version }}'
steps:
- id: 'checkout'
name: Check The Repo Out
uses: 'actions/checkout@v4'
with:
fetch-depth: 0
- name: Get Changed Test Relevant Files
id: 'list-changed-test'
uses: tj-actions/changed-files@v45
with:
files: |
charts/zitadel/**
examples/**/*.yaml
go.mod
go.sum
- id: 'add-cockroachdb-repo'
name: Add The CockroachDB Helm Repo
run: 'helm repo add cockroachdb https://charts.cockroachdb.com/'
if: steps.list-changed-test.outputs.any_changed == 'true'
- id: 'create-kind'
name: Create Kubernetes Cluster with KinD
uses: 'helm/[email protected]'
with:
node_image: 'kindest/node:${{ matrix.k8s.kindest-image-tag }}'
version: 'v0.23.0'
if: steps.list-changed-test.outputs.any_changed == 'true'
- id: 'setup-go'
uses: actions/setup-go@v5
with:
go-version: '1.22.3'
if: steps.list-changed-test.outputs.any_changed == 'true'
- id: 'test'
name: Run Go Tests
run: 'go test -p 1 ./...'
if: steps.list-changed-test.outputs.any_changed == 'true'
- id: 'zitadel-test-namespaces'
name: Grep Created Namespaces
run: |
echo "pgInsecure=$(kubectl get namespaces --output name | grep 1-postgres-insecure | cut -d / -f 2)" >> "$GITHUB_OUTPUT"
echo "pgSecure=$(kubectl get namespaces --output name | grep 2-postgres-secure | cut -d / -f 2)" >> "$GITHUB_OUTPUT"
echo "crInsecure=$(kubectl get namespaces --output name | grep 3-cockroach-insecure | cut -d / -f 2)" >> "$GITHUB_OUTPUT"
echo "crSecure=$(kubectl get namespaces --output name | grep 4-cockroach-secure | cut -d / -f 2)" >> "$GITHUB_OUTPUT"
echo "refSecrets=$(kubectl get namespaces --output name | grep 5-referenced-secrets | cut -d / -f 2)" >> "$GITHUB_OUTPUT"
echo "machineUser=$(kubectl get namespaces --output name | grep 6-machine-user | cut -d / -f 2)" >> "$GITHUB_OUTPUT"
echo "selfSigned=$(kubectl get namespaces --output name | grep 7-self-signed | cut -d / -f 2)" >> "$GITHUB_OUTPUT"
if: failure()
- id: 'namespace-report-pg-insecure'
name: Show ${{ steps.zitadel-test-namespaces.outputs.pgInsecure }} Namespace
uses: jupyterhub/action-k8s-namespace-report@v1
if: failure()
with:
namespace: ${{ steps.zitadel-test-namespaces.outputs.pgInsecure }}
- id: 'namespace-report-pg-secure'
name: Show ${{ steps.zitadel-test-namespaces.outputs.pgSecure }} Namespace
uses: jupyterhub/action-k8s-namespace-report@v1
if: failure()
with:
namespace: ${{ steps.zitadel-test-namespaces.outputs.pgSecure }}
- id: 'namespace-report-cr-insecure'
name: Show ${{ steps.zitadel-test-namespaces.outputs.crInsecure }} Namespace
uses: jupyterhub/action-k8s-namespace-report@v1
if: failure()
with:
namespace: ${{ steps.zitadel-test-namespaces.outputs.crInsecure }}
- id: 'namespace-report-cr-secure'
name: Show ${{ steps.zitadel-test-namespaces.outputs.crSecure }} Namespace
uses: jupyterhub/action-k8s-namespace-report@v1
if: failure()
with:
namespace: ${{ steps.zitadel-test-namespaces.outputs.crSecure }}
- id: 'namespace-report-ref-secrets'
name: Show ${{ steps.zitadel-test-namespaces.outputs.refSecrets }} Namespace
uses: jupyterhub/action-k8s-namespace-report@v1
if: failure()
with:
namespace: ${{ steps.zitadel-test-namespaces.outputs.refSecrets }}
- id: 'namespace-report-machine-user'
name: Show ${{ steps.zitadel-test-namespaces.outputs.machineUser }} Namespace
uses: jupyterhub/action-k8s-namespace-report@v1
if: failure()
with:
namespace: ${{ steps.zitadel-test-namespaces.outputs.machineUser }}
- id: 'namespace-report-self-signed'
name: Show ${{ steps.zitadel-test-namespaces.outputs.selfSigned }} Namespace
uses: jupyterhub/action-k8s-namespace-report@v1
if: failure()
with:
namespace: ${{ steps.zitadel-test-namespaces.outputs.selfSigned }}