File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,13 +3,30 @@ name: E2E Tests
33
44on :
55 workflow_dispatch :
6+ pull_request :
67
78permissions :
89 contents : read
10+ statuses : write
911
1012jobs :
1113
14+ set-pending :
15+ if : github.event_name == 'pull_request'
16+ runs-on : ubuntu-latest
17+ name : Set pending e2e status
18+ steps :
19+ - name : Set pending e2e status
20+ run : |
21+ gh api "repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha }}" \
22+ -f state="pending" \
23+ -f context="e2e" \
24+ -f description="E2E tests must be triggered manually via workflow_dispatch"
25+ env :
26+ GH_TOKEN : ${{ github.token }}
27+
1228 e2e :
29+ if : github.event_name == 'workflow_dispatch'
1330 runs-on : ubuntu-latest
1431 timeout-minutes : 5
1532
5572 E2E_RELEASE : ${{ matrix.release }}
5673 CONTAINER_RUNTIME : docker
5774 run : go test -tags e2e -v -race -timeout 5m -run ${{ matrix.test }} ./test/e2e/
75+
76+ report-status :
77+ if : always() && github.event_name == 'workflow_dispatch'
78+ needs : [e2e]
79+ runs-on : ubuntu-latest
80+ name : Report e2e status
81+ steps :
82+ - name : Report e2e status
83+ run : |
84+ if [ "${{ needs.e2e.result }}" = "success" ]; then
85+ state="success"
86+ description="All E2E tests passed"
87+ else
88+ state="failure"
89+ description="E2E tests failed"
90+ fi
91+ gh api "repos/${{ github.repository }}/statuses/${{ github.sha }}" \
92+ -f state="$state" \
93+ -f context="e2e" \
94+ -f description="$description"
95+ env :
96+ GH_TOKEN : ${{ github.token }}
You can’t perform that action at this time.
0 commit comments