Skip to content

Commit

Permalink
debug mr.json and test screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
darkweak committed Mar 1, 2024
1 parent c67bffe commit bccf054
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 84 deletions.
170 changes: 99 additions & 71 deletions .github/workflows/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,74 +4,74 @@ on:
- pull_request

jobs:
build-caddy-validator:
name: Check that Souin build as caddy module
runs-on: ubuntu-latest
services:
redis:
image: redis
ports:
- 6379:6379
etcd:
image: quay.io/coreos/etcd
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.21'
-
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@latest=../..
-
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
# build-caddy-validator:
# name: Check that Souin build as caddy module
# runs-on: ubuntu-latest
# services:
# redis:
# image: redis
# ports:
# - 6379:6379
# etcd:
# image: quay.io/coreos/etcd
# 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.21'
# -
# 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@latest=../..
# -
# 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
Expand All @@ -83,12 +83,12 @@ jobs:
sudo echo "127.0.0.1 domain.com etcd redis" | sudo tee -a /etc/hosts
-
name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: '1.21'

- name: Install Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18

Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
run: cd souin/plugins/caddy && xcaddy build --with github.com/darkweak/souin/plugins/caddy=./ --with github.com/darkweak/souin=../..
-
name: Run detached caddy
run: cd souin/plugins/caddy && ./caddy run --config souin/docs/cache-tests/cache-tests-caddyfile &
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
Expand All @@ -126,6 +126,34 @@ jobs:
-
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 # Required for headful puppeteer
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
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'
release_id: 144343803
-
name: Debug actions-image outputs
run: echo "${{join(steps.screenshot-uploader.outputs.*, '\n')}}"

# build-beego-validator:
# name: Check that Souin build as middleware
Expand Down
22 changes: 11 additions & 11 deletions docs/cache-tests/cache-tests-caddyfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
order cache before rewrite
cache {
api {
prometheus
souin
}
cdn {
dynamic
}
ttl 1000s
default_cache_control public
order cache before rewrite
cache {
api {
prometheus
souin
}
cdn {
dynamic
}
ttl 1000s
default_cache_control public
}
}

:4443
Expand Down
4 changes: 2 additions & 2 deletions docs/cache-tests/index.mjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
export default [
{
file: 'caddy.json',
name: 'caddy',
name: 'Caddy',
type: 'rev-proxy',
version: '0.7.0',
link: 'https://github.com/http-tests/cache-tests/wiki/Caddy'
},
{
file: 'mr.json',
name: 'Souin',
name: 'Merge request',
type: 'rev-proxy',
version: '0.0.1',
link: 'https://github.com/http-tests/cache-tests/wiki/Caddy'
Expand Down

0 comments on commit bccf054

Please sign in to comment.