-
Notifications
You must be signed in to change notification settings - Fork 0
157 lines (133 loc) · 3.93 KB
/
Copy pathe2e.yml
File metadata and controls
157 lines (133 loc) · 3.93 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: E2E Tests
on:
push:
branches:
- main
- develop
paths:
- "**.go"
- "e2e/**"
- ".github/workflows/e2e.yml"
- "go.mod"
- "go.sum"
pull_request:
branches:
- main
- develop
paths:
- "**.go"
- "e2e/**"
- ".github/workflows/e2e.yml"
- "go.mod"
- "go.sum"
env:
GO_VERSION: "1.26"
permissions: read-all
jobs:
e2e-tests:
name: E2E Tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
go-version: ["1.26"]
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Set up Go
uses: actions/setup-go@7b8cf10d4e4a01d4992d18a89f4d7dc5a3e6d6f4 # v4
with:
go-version: ${{ matrix.go-version }}
cache: true
cache-dependency-path: go.sum
- name: Set up Docker (Ubuntu)
if: runner.os == 'Linux'
run: |
# Docker is pre-installed on Ubuntu runners
docker --version
- name: Set up Docker (macOS)
if: runner.os == 'macOS'
run: |
# Install Docker on macOS via Docker Desktop
brew install docker docker-compose 2>/dev/null || true
docker --version 2>/dev/null || echo "Docker will be installed via Colima"
- name: Install dependencies
run: |
go mod download
go mod verify
- name: Build e2e tests
run: |
go test -c -o /dev/null ./e2e
env:
CGO_ENABLED: 1
- name: Run E2E tests with Ginkgo
run: |
go run github.com/onsi/ginkgo/v2/ginkgo@v2.28.0 run -v --timeout=10m --poll-progress-after=1m ./e2e
env:
CGO_ENABLED: 1
continue-on-error: false
- name: Run unit tests for helpers
run: |
go test -v ./e2e/helpers/... -timeout 5m
continue-on-error: false
- name: Collect test coverage
run: |
go test -v ./e2e -coverprofile=coverage-e2e.out
go tool cover -html=coverage-e2e.out -o coverage-e2e.html
continue-on-error: true
- name: Upload coverage reports
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: e2e-coverage-${{ matrix.os }}
path: coverage-e2e.*
- name: Upload test results
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: e2e-test-results-${{ matrix.os }}
path: |
e2e-test-results.json
e2e-test-results.xml
- name: Lint e2e tests
run: |
go vet ./e2e/...
continue-on-error: false
- name: Check code formatting
run: |
go fmt ./e2e/...
continue-on-error: false
e2e-linux:
name: E2E Tests (Linux - Detailed)
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Set up Go
uses: actions/setup-go@7b8cf10d4e4a01d4992d18a89f4d7dc5a3e6d6f4 # v4
with:
go-version: "1.26"
cache: true
cache-dependency-path: go.sum
- name: Run E2E tests with verbose output
run: |
go run github.com/onsi/ginkgo/v2/ginkgo@v2.28.0 run -v -r --timeout=10m --poll-progress-after=1m ./e2e
env:
CGO_ENABLED: 1
quality-gate:
name: Quality Gate
runs-on: ubuntu-latest
needs: [e2e-tests]
if: always()
steps:
- name: Check test results
run: |
if [ "${{ needs.e2e-tests.result }}" = "failure" ]; then
echo "E2E tests failed"
exit 1
fi
echo "All E2E tests passed"
- name: Status check
run: echo "E2E test suite completed successfully"