forked from agentgateway/agentgateway
-
Notifications
You must be signed in to change notification settings - Fork 0
228 lines (215 loc) · 6.68 KB
/
pull_request.yml
File metadata and controls
228 lines (215 loc) · 6.68 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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
name: Branch
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
CI: true
RUST_VERSION: "1.93.1"
GO_VERSION: "1.26.1"
jobs:
#### Proxy jobs ####
proxy-test:
strategy:
matrix:
include:
- os: ubuntu-24.04
validate: true
- os: windows-2025
validate: false
- os: macos-15
validate: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: "${{ env.RUST_VERSION }}"
- uses: Swatinem/rust-cache@v2
# Github cache is too tiny to handle the full matrix :-(
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
with:
# Github cache will restore from 'main' OR the current branch.
# If we cache PR branches, we may evict the 'main' cache and end up with no cache hits at all.
# Ideally, we would have main be 'high priority' and not be evicted but I don't think thats possible.
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Test
run: make test
- name: Validate
if: ${{ matrix.validate }}
run: make validate
proxy-lint:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: "${{ env.RUST_VERSION }}"
- uses: Swatinem/rust-cache@v2
with:
# Github cache will restore from 'main' OR the current branch.
# If we cache PR branches, we may evict the 'main' cache and end up with no cache hits at all.
# Ideally, we would have main be 'high priority' and not be evicted but I don't think thats possible.
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Generation
run: make generate-schema check-clean-repo
- name: Lint
run: make lint
#### UI jobs ####
ui-lint:
runs-on: ubuntu-24.04
defaults:
run:
working-directory: ui
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24
- name: Lint
run: |
npm ci
npm run lint
#### Controller jobs ####
controller-test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: "${{ env.GO_VERSION }}"
cache-dependency-path: |
**/*.sum
.github/workflows/cache-lint
- name: Test
run: go test -race ./...
controller-lint:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: "${{ env.GO_VERSION }}"
cache-dependency-path: |
**/*.sum
.github/workflows/cache-test
- name: Lint
run: make -C controller analyze
- name: go mod tidy
run: |
go mod tidy
git diff --exit-code go.mod go.sum
- name: Gen
# TODO: the rest of codegen
run: make generate-apis check-clean-repo
controller-e2e:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: "${{ env.RUST_VERSION }}"
- uses: Swatinem/rust-cache@v2
with:
# Github cache will restore from 'main' OR the current branch.
# If we cache PR branches, we may evict the 'main' cache and end up with no cache hits at all.
# Ideally, we would have main be 'high priority' and not be evicted but I don't think thats possible.
save-if: ${{ github.ref == 'refs/heads/main' }}
- uses: actions/setup-go@v6
with:
go-version: "${{ env.GO_VERSION }}"
cache-dependency-path: |
**/*.sum
.github/workflows/cache-e2e
- name: Set Path
run: |
echo "./tools" >> $GITHUB_PATH
- name: Setup
run: TEST_MODE=e2e ./controller/test/setup/setup-kind-ci.sh
- name: E2E
run: |
CGO_ENABLED=0 PERSIST_INSTALL=true go test -tags=e2e -v ./controller/test/e2e/tests -run '^TestAgentgatewayIntegration'
- name: Archive bug report directory on failure
if: ${{ failure() }}
uses: actions/upload-artifact@v6
with:
name: bug-report
path: ./controller/_test/bug_report/kind
retention-days: 2
- name: Upload cargo timings
uses: actions/upload-artifact@v6
with:
name: cargo-timings-e2e
path: target/cargo-timings/cargo-timing*.html
retention-days: 2
- name: Summary
run: |
echo '# E2E Timings\n'
cat controller/_test/ci-step-timings.log >> $GITHUB_STEP_SUMMARY
controller-conformance:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: "${{ env.RUST_VERSION }}"
- uses: Swatinem/rust-cache@v2
with:
# We only read the cache from 'E2E' job, since they should have identical cache.
save-if: "false"
shared-key: "controller-e2e" # Pull E2E job's cache
- uses: actions/setup-go@v6
with:
go-version: "${{ env.GO_VERSION }}"
cache-dependency-path: |
**/*.sum
.github/workflows/cache-e2e
- name: Set Path
run: |
echo "./tools" >> $GITHUB_PATH
- name: Setup
run: TEST_MODE=conformance ./controller/test/setup/setup-kind-ci.sh
- name: Conformance
run: |
make -C controller all-conformance
- name: Debug Info
if: ${{ failure() }}
run: |
kubectl describe deployment -n agentgateway-system
kubectl get pods -n agentgateway-system
kubectl logs -n agentgateway-system -l app.kubernetes.io/name=agentgateway
- name: Upload cargo timings
uses: actions/upload-artifact@v6
with:
name: cargo-timings-conformance
path: target/cargo-timings/cargo-timing*.html
retention-days: 2
- name: Summary
run: |
cat-yamls () {
local files=("$@")
local count=$#
for ((i=0; i<count-1; i++)); do
cat "${files[i]}"
echo -e "\n---"
done
if [ $count -gt 0 ]; then
cat "${files[count-1]}"
fi
}
echo -e '\n# Conformance Reports\n\n```yaml' >> $GITHUB_STEP_SUMMARY
cat-yamls ./controller/_test/conformance/*.yaml >> $GITHUB_STEP_SUMMARY
echo -e '```\n' >> $GITHUB_STEP_SUMMARY
echo -e '# Conformance Timings\n' >> $GITHUB_STEP_SUMMARY
cat controller/_test/ci-step-timings.log >> $GITHUB_STEP_SUMMARY