-
-
Notifications
You must be signed in to change notification settings - Fork 224
121 lines (91 loc) · 4.04 KB
/
docs-ci.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
name: Docs CI
on:
push:
paths:
- 'docs/**'
branches:
- main
pull_request:
paths:
- 'docs/**'
branches:
- '*'
workflow_dispatch:
jobs:
test-kind-multipod:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Kubernetes Kind
run: |
curl -Lo ./kind "https://kind.sigs.k8s.io/dl/v0.11.1/kind-linux-amd64"
chmod +x ./kind
./kind version
- name: Install kubectl
run: |
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.21.3/bin/linux/amd64/kubectl
chmod +x ./kubectl
- name: Create cluster
run: ./kind create cluster
- name: Install Kroki using Multiple Pods
run: ./kubectl apply -f docs/modules/setup/examples/k8s-multi-pod
- name: Kubectl version
run: ./kubectl version
- name: Wait until available
run: ./kubectl wait --for=condition=available --timeout=120s --all deployments.apps
- name: Check pod
run: ./kubectl get pod
- name: Forward port 8000 (background)
run: ./kubectl port-forward service/kroki 8000:8000 &
- name: Test SeqDiag
run: curl -o /dev/null -s -w "%{http_code}\n" http://localhost:8000/seqdiag/svg/eNorTi1MyUxMV6jmUlBIKsovL04tUtC1UyhPTQKyyoCc6JzEpNQcBVsFJXfXEAX9zLyU1Aq9jJLcHKVYayQ9Nrq6CE3WhA0L8A8GmpaUk5-un5yfm5uaVwIxD6EWqDElsSQxKbE4FUmfp1-wa1CIAg49IFfANOFxXS0A68hQUg== | grep 200
- name: Uninstall Kroki
run: ./kubectl delete -f docs/modules/setup/examples/k8s-multi-pod
- name: Delete cluster
run: ./kind delete cluster
test-kind-singlepod:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Kubernetes Kind
run: |
curl -Lo ./kind "https://kind.sigs.k8s.io/dl/v0.11.1/kind-linux-amd64"
chmod +x ./kind
./kind version
- name: Install kubectl
run: |
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.21.3/bin/linux/amd64/kubectl
chmod +x ./kubectl
- name: Create cluster
run: ./kind create cluster
- name: Install Kroki using a Single Pod
run: ./kubectl apply -f docs/modules/setup/examples/k8s-single-pod
- name: Kubectl version
run: ./kubectl version
- name: Wait until available
run: ./kubectl wait --for=condition=available --timeout=120s --all deployments.apps
- name: Check pod
run: ./kubectl get pod
- name: Forward port 8000 (background)
run: ./kubectl port-forward service/kroki 8000:8000 &
- name: Test SeqDiag
run: curl -o /dev/null -s -w "%{http_code}\n" http://localhost:8000/seqdiag/svg/eNorTi1MyUxMV6jmUlBIKsovL04tUtC1UyhPTQKyyoCc6JzEpNQcBVsFJXfXEAX9zLyU1Aq9jJLcHKVYayQ9Nrq6CE3WhA0L8A8GmpaUk5-un5yfm5uaVwIxD6EWqDElsSQxKbE4FUmfp1-wa1CIAg49IFfANOFxXS0A68hQUg== | grep 200
- name: Uninstall Kroki
run: ./kubectl delete -f docs/modules/setup/examples/k8s-single-pod
- name: Delete cluster
run: ./kind delete cluster
test-dockercompose:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup Docker
# taken from https://github.com/docker/github-actions/blob/0f18e2abad9a4ac2963d2516246787375b5ec917/Dockerfile#L32
run: curl -fL https://download.docker.com/linux/static/stable/x86_64/docker-20.10.21.tgz | tar xzO docker/docker > docker && sudo mv -f docker /usr/bin/docker && sudo chmod +x /usr/bin/docker
- name: docker-compose up
run: docker-compose -f docs/modules/setup/examples/kroki-docker-compose.yml up -d
- name: Wait until available
run: |
./ci/tests/wait-for-it.sh localhost:8000 --timeout=40
sleep 20
- name: Test SeqDiag
run: curl -o /dev/null -s -w "%{http_code}\n" http://localhost:8000/seqdiag/svg/eNorTi1MyUxMV6jmUlBIKsovL04tUtC1UyhPTQKyyoCc6JzEpNQcBVsFJXfXEAX9zLyU1Aq9jJLcHKVYayQ9Nrq6CE3WhA0L8A8GmpaUk5-un5yfm5uaVwIxD6EWqDElsSQxKbE4FUmfp1-wa1CIAg49IFfANOFxXS0A68hQUg== | grep 200