-
Notifications
You must be signed in to change notification settings - Fork 56
237 lines (232 loc) · 7.56 KB
/
plugins.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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
name: Build and validate Souin as plugins
on:
- pull_request
jobs:
build-caddy-validator:
name: Caddy
runs-on: ubuntu-latest
services:
nats:
image: darkweak/nats
ports:
- 4222:4222
- 6222:6222
- 8222:8222
redis:
image: redis
ports:
- 6379:6379
etcd:
image: quay.io/coreos/etcd:v3.5.13
env:
ETCD_NAME: etcd0
ETCD_ADVERTISE_CLIENT_URLS: http://etcd:2379,http://etcd:4001
ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:2379,http://0.0.0.0:4001
ETCD_INITIAL_ADVERTISE_PEER_URLS: http://etcd:2380
ETCD_LISTEN_PEER_URLS: http://0.0.0.0:2380
ETCD_INITIAL_CLUSTER_TOKEN: etcd-cluster-1
ETCD_INITIAL_CLUSTER: etcd0=http://etcd:2380
ETCD_INITIAL_CLUSTER_STATE: new
ports:
- 2379:2379
- 2380:2380
- 4001:4001
steps:
-
name: Add domain.com host to /etc/hosts
run: |
sudo echo "127.0.0.1 domain.com etcd redis" | sudo tee -a /etc/hosts
-
name: Install Go
uses: actions/setup-go@v3
with:
go-version: '1.22'
-
name: Checkout code
uses: actions/checkout@v4
-
name: Install xcaddy
run: go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
-
name: Build Souin as caddy module
run: cd plugins/caddy && xcaddy build --with github.com/darkweak/souin/plugins/caddy=./ --with github.com/darkweak/souin=../.. --with github.com/darkweak/storages/badger/caddy --with github.com/darkweak/storages/etcd/caddy --with github.com/darkweak/storages/nats/caddy --with github.com/darkweak/storages/nuts/caddy --with github.com/darkweak/storages/olric/caddy --with github.com/darkweak/storages/otter/caddy --with github.com/darkweak/storages/redis/caddy
-
name: Run Caddy tests
run: cd plugins/caddy && go test -v ./...
-
name: Run detached caddy
run: cd plugins/caddy && ./caddy run &
-
name: Run Caddy E2E tests
uses: matt-ball/newman-action@master
with:
collection: "docs/e2e/Souin E2E.postman_collection.json"
folder: '["Caddy"]'
delayRequest: 5000
-
name: Run detached caddy
run: cd plugins/caddy && ./caddy stop
-
name: Run detached caddy
run: cd plugins/caddy && ./caddy run --config ./configuration.json &
-
name: Run Caddy E2E tests
uses: matt-ball/newman-action@master
with:
collection: "docs/e2e/Souin E2E.postman_collection.json"
folder: '["Caddy"]'
delayRequest: 5000
run-cache-tests:
needs: build-caddy-validator
name: Run cache-tests suite requirements and add the generated screenshot to the PR
runs-on: ubuntu-latest
steps:
-
name: Add domain.com host to /etc/hosts
run: |
sudo echo "127.0.0.1 domain.com etcd redis" | sudo tee -a /etc/hosts
-
name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: latest
-
name: Checkout Souin code
uses: actions/checkout@v4
with:
repository: darkweak/souin
path: souin
-
name: Checkout cache-tests code
uses: actions/checkout@v4
with:
repository: http-tests/cache-tests
path: cache-tests
-
name: Install xcaddy
run: go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
-
name: Build Souin as caddy module for current commit
run: cd souin/plugins/caddy && xcaddy build --with github.com/darkweak/souin/plugins/caddy=./ --with github.com/darkweak/souin=../.. --with github.com/darkweak/storages/badger/caddy --with github.com/darkweak/storages/etcd/caddy --with github.com/darkweak/storages/nats/caddy --with github.com/darkweak/storages/nuts/caddy --with github.com/darkweak/storages/olric/caddy --with github.com/darkweak/storages/otter/caddy --with github.com/darkweak/storages/redis/caddy
-
name: Run detached caddy
run: cd souin/plugins/caddy && ./caddy run --config ../../docs/cache-tests/cache-tests-caddyfile --adapter caddyfile &
-
name: Sync index.mjs from souin to cache-tests
run: cp souin/docs/cache-tests/index.mjs cache-tests/results/index.mjs
-
name: Run detached cache-tests server
run: cd cache-tests && pnpm install && pnpm run server &
-
name: Run cache-tests test suite
run: cd cache-tests && ./test-host.sh 127.0.0.1:4443 > results/mr.json
-
name: install puppeteer-headful
uses: mujo-code/puppeteer-headful@master
env:
CI: 'true'
-
name: screenshots-ci-action
uses: flameddd/screenshots-ci-action@master
with:
url: http://127.0.0.1:8000/
devices: iPad Pro landscape
noDesktop: true
noCommitHashFileName: true
fullPage: true
releaseId: 144343803
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
name: Upload screenshot artifacts
id: screenshot-uploader
uses: edunad/actions-image@master
with:
path: screenshots/iPad_Pro_landscape.jpeg
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
title: 'cache-tests suite result'
build-beego-validator:
uses: ./.github/workflows/plugin_template.yml
secrets: inherit
with:
CAPITALIZED_NAME: Beego
LOWER_NAME: beego
GO_VERSION: '1.22'
build-chi-validator:
uses: ./.github/workflows/plugin_template.yml
secrets: inherit
with:
CAPITALIZED_NAME: Chi
LOWER_NAME: chi
GO_VERSION: '1.22'
build-dotweb-validator:
uses: ./.github/workflows/plugin_template.yml
secrets: inherit
with:
CAPITALIZED_NAME: Dotweb
LOWER_NAME: dotweb
GO_VERSION: '1.22'
build-echo-validator:
uses: ./.github/workflows/plugin_template.yml
secrets: inherit
with:
CAPITALIZED_NAME: Echo
LOWER_NAME: echo
GO_VERSION: '1.22'
build-fiber-validator:
uses: ./.github/workflows/plugin_template.yml
secrets: inherit
with:
CAPITALIZED_NAME: Fiber
LOWER_NAME: fiber
GO_VERSION: '1.22'
build-gin-validator:
uses: ./.github/workflows/plugin_template.yml
secrets: inherit
with:
CAPITALIZED_NAME: Gin
LOWER_NAME: gin
GO_VERSION: '1.22'
build-goa-validator:
uses: ./.github/workflows/plugin_template.yml
secrets: inherit
with:
CAPITALIZED_NAME: Goa
LOWER_NAME: goa
GO_VERSION: '1.22'
build-kratos-validator:
uses: ./.github/workflows/plugin_template.yml
secrets: inherit
with:
CAPITALIZED_NAME: Kratos
LOWER_NAME: kratos
GO_VERSION: '1.22'
build-souin-validator:
uses: ./.github/workflows/plugin_template.yml
secrets: inherit
with:
CAPITALIZED_NAME: Souin
LOWER_NAME: souin
GO_VERSION: '1.22'
build-traefik-validator:
uses: ./.github/workflows/plugin_template.yml
secrets: inherit
with:
CAPITALIZED_NAME: Traefik
LOWER_NAME: traefik
GO_VERSION: '1.22'
build-webgo-validator:
uses: ./.github/workflows/plugin_template.yml
secrets: inherit
with:
CAPITALIZED_NAME: Webgo
LOWER_NAME: webgo
GO_VERSION: '1.22'