-
Notifications
You must be signed in to change notification settings - Fork 58
72 lines (70 loc) · 2.26 KB
/
plugin_template.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
name: Atomic plugin
on:
workflow_call:
inputs:
LOWER_NAME:
required: true
type: string
CAPITALIZED_NAME:
required: true
type: string
GO_VERSION:
required: true
type: string
jobs:
plugin-test:
name: ${{ inputs.CAPITALIZED_NAME }}
runs-on: ubuntu-latest
env:
GO_VERSION: ${{ inputs.GO_VERSION }}
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@v3
with:
go-version: ${{ inputs.GO_VERSION }}
-
name: Checkout code
uses: actions/checkout@v4
-
name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.59.1
working-directory: plugins/${{ inputs.LOWER_NAME }}
args: --exclude-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: matt-ball/newman-action@master
with:
collection: "docs/e2e/Souin E2E.postman_collection.json"
folder: '["${{ inputs.CAPITALIZED_NAME }}"]'
delayRequest: 5000