Skip to content

Commit

Permalink
feat(chore): refactoring to middleware philosophy (#308)
Browse files Browse the repository at this point in the history
* feat(chore): refactoring to middleware philosophy

* feat: caddy, gin, go-zero, kratos migration

* fix: newman e2e tests for caddy

* feat: beego support

* feat: migrate chi, dotweb, webgo

* feat: migrate fiber and goyave

* feat: traefik migration

* feat: skipper and roadrunner migration

* feat: tyk migration

* fix: unit tests

* feat: E2E migration

* feat: start pkg unit tests

* feat: souin migration

* fix: tyk

* feat: start clear unused code

* fix: remove plugins dep

* wip: decommissioning souin/rfc souin/api souin/cache/providers

* wip: next decommissioning

* fix: run lint on every plugins

* feat: set cdn dynamic to true by default

* feat: re-implement esi parsing

* fix: CI tests

* feat: bump all deps

* feat: add scheme to the key

* fix: decrease tagged version temporary

* feat: bump again the versions

* fix: caddy documentation change redis port to the default one

* feat: extend waiting time to run E2E tests
  • Loading branch information
darkweak authored Mar 1, 2023
1 parent bd0c436 commit 1ef85a8
Show file tree
Hide file tree
Showing 845 changed files with 68,973 additions and 22,023 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/non-regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
with:
go-version: 1.19
- name: Run unit static tests
run: go test -v -race $(go list ./... | grep -v cache/providers)
run: go test -v -race $(go list ./... | grep -v cache/providers | grep -v pkg/storage)
unit-test-golang-with-services:
needs: lint-validation
name: Unit tests with external services
Expand All @@ -45,9 +45,10 @@ jobs:
run: |
docker network create your_network || true
docker-compose -f docker-compose.yml.test up -d --build --force-recreate --remove-orphans
- name: Run tests
# disabled race to pass the EmbeddedOlric test
run: docker-compose -f docker-compose.yml.test exec -T souin go test -v ./cache/providers
- name: Run cache providers tests
run: docker-compose -f docker-compose.yml.test exec -T souin go test -v -race ./cache/providers
- name: Run pkg storage tests
run: docker-compose -f docker-compose.yml.test exec -T souin go test -v -race ./pkg/storage
validate-prod-container-building:
needs: unit-test-golang-with-services
name: Validate that the container build for prod
Expand All @@ -64,4 +65,4 @@ jobs:
run: docker-compose -f docker-compose.yml.prod up -d --build --force-recreate --remove-orphans
-
name: Souin container healthceck
run: docker-compose -f docker-compose.yml.prod exec -T souin ls
run: docker-compose -f docker-compose.yml.prod exec -T souin ls
67 changes: 67 additions & 0 deletions .github/workflows/plugin_template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Atomic plugin

on:
workflow_call:
inputs:
LOWER_NAME:
required: true
type: string
CAPITALIZED_NAME:
required: true
type: string

jobs:
plugin-test:
name: Check that Souin build as ${{ inputs.CAPITALIZED_NAME }} middleware
runs-on: ubuntu-latest
steps:
-
name: Add domain.com host to /etc/hosts
run: |
sudo echo "127.0.0.1 domain.com" | sudo tee -a /etc/hosts
-
name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.19
-
name: Checkout code
uses: actions/checkout@v2
-
name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
working-directory: plugins/${{ inputs.LOWER_NAME }}
args: --skip-dirs=override --timeout=240s
-
name: Run ${{ inputs.CAPITALIZED_NAME }} tests
run: cd plugins/${{ inputs.LOWER_NAME }} && go test -v .
-
name: Build Souin as ${{ inputs.CAPITALIZED_NAME }} plugin
run: make build-and-run-${{ inputs.LOWER_NAME }}
env:
GH_APP_TOKEN: ${{ secrets.GH_APP_TOKEN }}
CURRENT_SHA: ${{ github.event.pull_request.head.sha }}
-
name: Wait for Souin is really loaded inside ${{ inputs.CAPITALIZED_NAME }} as middleware
uses: jakejarvis/wait-action@master
with:
time: 75s
-
name: Set ${{ inputs.CAPITALIZED_NAME }} logs configuration result as environment variable
run: cd plugins/${{ inputs.LOWER_NAME }} && echo "$(make load-checker)" >> $GITHUB_ENV
-
name: Check if the configuration is loaded to define if Souin is loaded too
uses: nick-invision/assert-action@v1
with:
expected: 'Souin configuration is now loaded.'
actual: ${{ env.MIDDLEWARE_RESULT }}
comparison: contains
-
name: Run ${{ inputs.CAPITALIZED_NAME }} E2E tests
uses: anthonyvscode/newman-action@v1
with:
collection: "docs/e2e/Souin E2E.postman_collection.json"
folder: ${{ inputs.CAPITALIZED_NAME }}
reporters: cli
delayRequest: 5000
Loading

0 comments on commit 1ef85a8

Please sign in to comment.