-
-
Notifications
You must be signed in to change notification settings - Fork 17
92 lines (79 loc) · 3.42 KB
/
e2e.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
87
88
89
90
91
92
name: end-2-end Helm Chart Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
e2e:
runs-on: ubuntu-latest
strategy:
matrix:
# https://hub.docker.com/r/kindest/node/tags
k8s_version: [ "v1.28.13", "v1.29.8", "v1.30.4" ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install kind with registry
uses: bakito/kind-with-registry-action@main
with:
ingress_enabled: true
node_image: kindest/node:${{ matrix.k8s_version }}
kubectl_version: ${{ matrix.k8s_version }}
- name: Build image
run: ./testdata/e2e/buildImage.sh
- name: Install sealed-secrets
run: |
helm repo add sealed-secrets https://bitnami-labs.github.io/sealed-secrets
helm install sealed-secrets sealed-secrets/sealed-secrets \
--namespace sealed-secrets \
--create-namespace \
--atomic
- name: Install sealed-secrets-web with yaml format In-Cluster
run: ./testdata/e2e/installSealedSecretsWebChart.sh yaml ""
- name: 🏠 Install sealed-secrets-web with json format In-Cluster
run: |
helm delete sealed-secrets-web --namespace sealed-secrets-web
./testdata/e2e/installSealedSecretsWebChart.sh json ""
- name: 🏠 Run Tests In-Cluster
id: run_tests_in_cluster
# continue on error to show logs
continue-on-error: true
working-directory: testdata/e2e
run: ./runTests.sh
- name: 🏠 Print logs In-Cluster
run: |
echo '🏠 Pod logs (json format In-Cluster)' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
POD_NAME=$(kubectl get pod -n sealed-secrets-web -l app.kubernetes.io/instance=sealed-secrets-web -o name)
kubectl logs -n sealed-secrets-web ${POD_NAME} >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- name: 🏠 Fail if 'Run Tests In-Cluster' failed
if: steps.run_tests_in_cluster.outcome=='failure'
run: |
echo "Step 'Run Tests In-Cluster' failed: Check 'Run Tests In-Cluster' and 'Print logs In-Cluster' as well as the job summary for errors"
exit 1
- name: 🔐 Install sealed-secrets-web with json format and cert URL
run: |
helm delete sealed-secrets-web --namespace sealed-secrets-web
./testdata/e2e/installSealedSecretsWebChart.sh json http://sealed-secrets.sealed-secrets.svc:8080/v1/cert.pem
- name: 🔐 Run Tests Cert-URL
id: run_tests_certURL
# continue on error to show logs
continue-on-error: true
working-directory: testdata/e2e
run: ./runTests.sh skip-validate
- name: 🔐 Print logs Cert-URL
run: |
echo '🔐 Pod logs (json format and Cert-URL)' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
POD_NAME=$(kubectl get pod -n sealed-secrets-web -l app.kubernetes.io/instance=sealed-secrets-web -o name)
kubectl logs -n sealed-secrets-web ${POD_NAME} >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- name: 🔐 Fail if 'Run Tests Cert-URL' failed
if: steps.run_tests_certURL.outcome=='failure'
run: |
echo "Step 'Run Tests Cert-URL' failed: Check 'Run Tests Cert-URL' and 'Print logsCert-URL' as well as the job summary for errors"
exit 1