-
Notifications
You must be signed in to change notification settings - Fork 0
191 lines (167 loc) · 4.91 KB
/
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
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
name: Test
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test-with-values:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Create yaml file
run: |
cat <<EOF > config.yaml
chains:
- id: osmosis-1
name: osmosis
numValidators: 1
ports:
rest: 1313
rpc: 26653
resources:
limits:
cpu: "0.2"
memory: "200M"
requests:
cpu: "0.1"
memory: "100M"
- id: wasmd
name: wasmd
numValidators: 1
ports:
rpc: 26659
rest: 1319
resources:
limits:
cpu: "0.2"
memory: "200M"
requests:
cpu: "0.1"
memory: "100M"
EOF
cat config.yaml
- uses: ./
id: starship
with:
port-forward: true
name: test-with-values
values: config.yaml
- name: Check kubectl pods
run: |
for chain in wasmd osmosis-1; do
kubectl get pods $chain-genesis-0 --namespace $NAMESPACE
done
env:
NAMESPACE: ${{ steps.starship.outputs.namespace }}
- name: Check port forwarded status
run: |
for port in 26659 26653; do
status_code=$(curl --write-out %{http_code} --silent --output /dev/null http://localhost:$port/status)
if [[ "$status_code" -ne 200 ]]; then
echo "Expected status code: 200, got: $status_code, from http://localhost:$port/status"
exit 1
else
echo "Successfully connected to: http://localhost:$port/status"
fi
done
- name: Cleanup cluster
run: |
helm delete $NAME --debug --namespace $NAMESPACE --wait
kubectl delete namespace $NAMESPACE --wait=true
env:
NAMESPACE: ${{ steps.starship.outputs.namespace }}
NAME: ${{ steps.starship.outputs.name }}
test-with-remote-cluster:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: echo -e "$TEMP_KUBECONFIG" > /tmp/kubeconfig
shell: bash
env:
TEMP_KUBECONFIG: |
apiVersion: v1
kind: Config
preferences: {}
- name: Setup kind cluster
if: ${{ inputs.kubeconfig == '' }}
uses: helm/[email protected]
with:
cluster_name: kind-starship
env:
KUBECONFIG: /tmp/kubeconfig
- name: Read kubeconfig
id: kubeconfig
uses: juliangruber/read-file-action@v1
with:
path: /tmp/kubeconfig
- name: Create yaml file
run: |
cat <<EOF > config.yaml
chains:
- id: osmosis-1
name: osmosis
numValidators: 1
ports:
rest: 1313
rpc: 26653
resources:
cpu: "0.2"
memory: "200M"
EOF
- uses: ./
id: starship
with:
port-forward: true
name: test-kubeconfig
kubeconfig: ${{ steps.kubeconfig.outputs.content }}
values: config.yaml
- name: Check kubectl pods
run: |
kubectl get pods osmosis-1-genesis-0 --namespace $NAMESPACE
env:
NAMESPACE: ${{ steps.starship.outputs.namespace }}
- name: Cleanup cluster
run: |
helm delete $NAME --debug --namespace $NAMESPACE --wait
kubectl delete namespace $NAMESPACE --wait=true
env:
NAMESPACE: ${{ steps.starship.outputs.namespace }}
NAME: ${{ steps.starship.outputs.name }}
test-with-no-portforward:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Create yaml file
run: |
cat <<EOF > config.yaml
chains:
- id: osmosis-1
name: osmosis
numValidators: 1
resources:
cpu: "0.2"
memory: "200M"
EOF
- uses: ./
id: starship
with:
port-forward: false
name: test-no-portforward
values: config.yaml
- name: Check kubectl pods
run: |
for chain in osmosis-1; do
kubectl get pods $chain-genesis-0 --namespace $NAMESPACE
done
env:
NAMESPACE: ${{ steps.starship.outputs.namespace }}
- name: Cleanup cluster
run: |
helm delete $NAME --debug --namespace $NAMESPACE --wait
kubectl delete namespace $NAMESPACE --wait=true
env:
NAMESPACE: ${{ steps.starship.outputs.namespace }}
NAME: ${{ steps.starship.outputs.name }}