-
Notifications
You must be signed in to change notification settings - Fork 0
196 lines (159 loc) · 5.26 KB
/
dry-run.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
name: dry-run in kind
env:
kind_version: "v0.14.0"
kind_kubectl_version: "v1.24.1"
argocd_params: "--grpc-web --insecure --server argocd.127.0.0.1.nip.io"
argocd_version: "2.3.4"
argocd_projects_dir: "argocd/projects"
go_version: '>=1.18.0'
ACK_GINKGO_DEPRECATIONS: "1.16.5"
on:
workflow_dispatch:
workflow_run:
workflows:
- "trivy check"
- "sh-checker"
- "terrascan"
- "tflint"
- "tfsec"
branches:
- main
pull_request:
branches:
- main
types:
- completed
pull_request:
branches:
- main
paths:
- .github/workflows/dry-run.yml
- argocd/**
- kind/**
- tests/e2e/**
- Makefile
# push:
# branches-ignore:
# - main
# paths:
# - .github/workflows/dry-run.yml
# - argocd/**
# - kind/**
# - tests/e2e/**
# - Makefile
jobs:
dry-run:
runs-on: ubuntu-latest
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
permissions:
checks: write
pull-requests: write
steps:
- name: "prepare env: clone repo"
uses: actions/checkout@v3
# - name: "prepare env: show vars"
# run: env
# - name: "debug: end workflow"
# run: "false"
- name: "prepare env: install make"
run: |
sudo apt update
sudo apt install make -y
- name: "prepare env: install golang"
uses: actions/setup-go@v4
with:
go-version: ${{ env.go_version }}
- name: "prepare env: init kind"
uses: helm/kind-action@main
with:
version: "${{ env.kind_version }}"
kubectl_version: "${{ env.kind_kubectl_version }}"
install_only: true
- name: "cluster create"
run: make kind-prepare-files kind-create
- name: "debug info: golang version"
run: go version
- name: "debug info: kubectl version"
run: kubectl version
- name: "debug info: k8s nodes and cluster-info"
run: kubectl get nodes -o wide; kubectl cluster-info
- name: "prepare cluster: fix prometheus-operator's CRDs"
run: make kind-install-crds
- name: "prepare cluster: install cilium"
run: make cilium-install
- name: "prepare cluster: show all pods"
run: sleep 5 && kubectl get pods -A
- name: "prepare cluster: install ArgoCD"
run: make argocd-deploy
- name: "prepare cluster: install nginx-ingress (and gateway-api CRDs)"
run: make nginx-ingress-deploy
- name: "prepare cluster: install cert-manager"
run: make cert-manager-deploy
- name: "debug info: wait"
run: sleep 10
- name: "debug info: show all pods"
run: kubectl get pods -A
- name: "debug info: show all services"
run: kubectl get svc -A
- name: "argo-cd: cli init"
uses: clowdhaus/argo-cd-action/@main
with:
version: ${{ env.argocd_version }}
command: version
options: --client
- name: "argo-cd: create projects"
run: kubectl apply -f ${{ env.argocd_projects_dir }}
- name: "argo-cd: install changed app's defs"
id: detectApps
run: ./scripts/detect_updated_argocd_apps.sh
- name: "argo-cd: show all apps"
run: argocd app list ${{ env.argocd_params }}
- name: run test-network test - assets
run: make test-network-apply-assets
- name: run test-network test - wait to assets
run: |
kubectl wait -n test-network --timeout=2m --for=condition=available deployment client
kubectl wait -n test-network --timeout=2m --for=condition=available deployment podinfo
- name: run test-network test - debug
run: kubectl -n test-network get po,svc,cnp
- name: run test-network test - check
run: |
rs=$(make test-network-check-status)
echo "$rs"
echo "$rs" |grep "greetings from podinfo"
- name: "e2e tests: install dependencies"
run: |
cd tests/e2e
go mod vendor
go env -w GO111MODULE=auto
- name: "e2e tests: run"
id: runE2eTests
run: |
echo "INFO: extra scenarios: ${{ env.SCENARIOS }}"
cd tests/e2e
go test ./kubernetes/... ./certManager/... ${{ env.SCENARIOS }} -report-dir=./junit -v
- name: "e2e tests: debug info"
if: failure() && steps.runE2eTests.outcome == 'failure'
run: |
kubectl get pods -A -o wide || true
kubectl get svc -A || true
kubectl get secrets -A || true
kubectl get cnp -A || true
kubectl get ccnp -A || true
kubectl get issuers -A || true
kubectl get certificates -A || true
- name: "e2e tests: debug info 2"
if: failure() && steps.runE2eTests.outcome == 'failure'
run: argocd app get prometheus-stack ${{ env.argocd_params }}
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/composite@v1
if: always()
with:
comment_mode: off
files: 'tests/e2e/**/junit_*.xml'
- name: "debug info: kind debug"
if: always()
run: make kind-debug
- name: "kind: delete cluster"
if: always()
run: make kind-delete