Skip to content

Commit 1ef85a8

Browse files
authored
feat(chore): refactoring to middleware philosophy (#308)
* 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
1 parent bd0c436 commit 1ef85a8

File tree

845 files changed

+68973
-22023
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

845 files changed

+68973
-22023
lines changed

.github/workflows/non-regression.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
with:
3030
go-version: 1.19
3131
- name: Run unit static tests
32-
run: go test -v -race $(go list ./... | grep -v cache/providers)
32+
run: go test -v -race $(go list ./... | grep -v cache/providers | grep -v pkg/storage)
3333
unit-test-golang-with-services:
3434
needs: lint-validation
3535
name: Unit tests with external services
@@ -45,9 +45,10 @@ jobs:
4545
run: |
4646
docker network create your_network || true
4747
docker-compose -f docker-compose.yml.test up -d --build --force-recreate --remove-orphans
48-
- name: Run tests
49-
# disabled race to pass the EmbeddedOlric test
50-
run: docker-compose -f docker-compose.yml.test exec -T souin go test -v ./cache/providers
48+
- name: Run cache providers tests
49+
run: docker-compose -f docker-compose.yml.test exec -T souin go test -v -race ./cache/providers
50+
- name: Run pkg storage tests
51+
run: docker-compose -f docker-compose.yml.test exec -T souin go test -v -race ./pkg/storage
5152
validate-prod-container-building:
5253
needs: unit-test-golang-with-services
5354
name: Validate that the container build for prod
@@ -64,4 +65,4 @@ jobs:
6465
run: docker-compose -f docker-compose.yml.prod up -d --build --force-recreate --remove-orphans
6566
-
6667
name: Souin container healthceck
67-
run: docker-compose -f docker-compose.yml.prod exec -T souin ls
68+
run: docker-compose -f docker-compose.yml.prod exec -T souin ls

.github/workflows/plugin_template.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Atomic plugin
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
LOWER_NAME:
7+
required: true
8+
type: string
9+
CAPITALIZED_NAME:
10+
required: true
11+
type: string
12+
13+
jobs:
14+
plugin-test:
15+
name: Check that Souin build as ${{ inputs.CAPITALIZED_NAME }} middleware
16+
runs-on: ubuntu-latest
17+
steps:
18+
-
19+
name: Add domain.com host to /etc/hosts
20+
run: |
21+
sudo echo "127.0.0.1 domain.com" | sudo tee -a /etc/hosts
22+
-
23+
name: Install Go
24+
uses: actions/setup-go@v2
25+
with:
26+
go-version: 1.19
27+
-
28+
name: Checkout code
29+
uses: actions/checkout@v2
30+
-
31+
name: golangci-lint
32+
uses: golangci/golangci-lint-action@v3
33+
with:
34+
working-directory: plugins/${{ inputs.LOWER_NAME }}
35+
args: --skip-dirs=override --timeout=240s
36+
-
37+
name: Run ${{ inputs.CAPITALIZED_NAME }} tests
38+
run: cd plugins/${{ inputs.LOWER_NAME }} && go test -v .
39+
-
40+
name: Build Souin as ${{ inputs.CAPITALIZED_NAME }} plugin
41+
run: make build-and-run-${{ inputs.LOWER_NAME }}
42+
env:
43+
GH_APP_TOKEN: ${{ secrets.GH_APP_TOKEN }}
44+
CURRENT_SHA: ${{ github.event.pull_request.head.sha }}
45+
-
46+
name: Wait for Souin is really loaded inside ${{ inputs.CAPITALIZED_NAME }} as middleware
47+
uses: jakejarvis/wait-action@master
48+
with:
49+
time: 75s
50+
-
51+
name: Set ${{ inputs.CAPITALIZED_NAME }} logs configuration result as environment variable
52+
run: cd plugins/${{ inputs.LOWER_NAME }} && echo "$(make load-checker)" >> $GITHUB_ENV
53+
-
54+
name: Check if the configuration is loaded to define if Souin is loaded too
55+
uses: nick-invision/assert-action@v1
56+
with:
57+
expected: 'Souin configuration is now loaded.'
58+
actual: ${{ env.MIDDLEWARE_RESULT }}
59+
comparison: contains
60+
-
61+
name: Run ${{ inputs.CAPITALIZED_NAME }} E2E tests
62+
uses: anthonyvscode/newman-action@v1
63+
with:
64+
collection: "docs/e2e/Souin E2E.postman_collection.json"
65+
folder: ${{ inputs.CAPITALIZED_NAME }}
66+
reporters: cli
67+
delayRequest: 5000

0 commit comments

Comments
 (0)