Something went wrong. Try again.
forked from darkweak/souin
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252name: Build and validate Souin as plugins
on: - pull_request
jobs: build-caddy-validator: name: Caddy 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@v3 with: go-version: '1.27' - 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 ./... build-caddy-validator-e2e: needs: build-caddy-validator name: Caddy runs-on: ubuntu-latest services: 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.27' - 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 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.27'
- name: Install Node.js uses: actions/setup-node@v4 with: node-version: 24
- uses: pnpm/action-setup@v3 name: Install pnpm with: version: 11.5.1 - 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: Wait for Souin is really loaded inside caddy as middleware uses: jakejarvis/wait-action@master with: time: 10s - 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 }}
build-beego-validator: uses: ./.github/workflows/plugin_template.yml secrets: inherit with: CAPITALIZED_NAME: Beego LOWER_NAME: beego GO_VERSION: '1.27' build-chi-validator: uses: ./.github/workflows/plugin_template.yml secrets: inherit with: CAPITALIZED_NAME: Chi LOWER_NAME: chi GO_VERSION: '1.27' build-dotweb-validator: uses: ./.github/workflows/plugin_template.yml secrets: inherit with: CAPITALIZED_NAME: Dotweb LOWER_NAME: dotweb GO_VERSION: '1.27' build-echo-validator: uses: ./.github/workflows/plugin_template.yml secrets: inherit with: CAPITALIZED_NAME: Echo LOWER_NAME: echo GO_VERSION: '1.27' build-fiber-validator: uses: ./.github/workflows/plugin_template.yml secrets: inherit with: CAPITALIZED_NAME: Fiber LOWER_NAME: fiber GO_VERSION: '1.27' build-gin-validator: uses: ./.github/workflows/plugin_template.yml secrets: inherit with: CAPITALIZED_NAME: Gin LOWER_NAME: gin GO_VERSION: '1.27' build-goa-validator: uses: ./.github/workflows/plugin_template.yml secrets: inherit with: CAPITALIZED_NAME: Goa LOWER_NAME: goa GO_VERSION: '1.27' build-kratos-validator: uses: ./.github/workflows/plugin_template.yml secrets: inherit with: CAPITALIZED_NAME: Kratos LOWER_NAME: kratos GO_VERSION: '1.27' build-souin-validator: uses: ./.github/workflows/plugin_template.yml secrets: inherit with: CAPITALIZED_NAME: Souin LOWER_NAME: souin GO_VERSION: '1.27' build-traefik-validator: uses: ./.github/workflows/plugin_template.yml secrets: inherit with: CAPITALIZED_NAME: Traefik LOWER_NAME: traefik GO_VERSION: '1.27' build-webgo-validator: uses: ./.github/workflows/plugin_template.yml secrets: inherit with: CAPITALIZED_NAME: Webgo LOWER_NAME: webgo GO_VERSION: '1.27'