Skip to content

Commit 597d739

Browse files
committed
ci: narrow e2e skip gate to pull_request events only
Addresses review feedback: the skip condition was too broad (github.event_name != 'merge_group'), which would also skip on direct pushes to main, allowing publish without E2E validation. Changed to github.event_name == 'pull_request' so the full E2E runs on both merge_group and push events.
1 parent 9173091 commit 597d739

1 file changed

Lines changed: 23 additions & 23 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -161,34 +161,34 @@ jobs:
161161
runs-on: depot-ubuntu-24.04-8
162162
timeout-minutes: 45
163163
steps:
164-
# ---- PR fast-path: skip heavy E2E ----
165-
- name: Skip full E2E outside merge queue
166-
if: github.event_name != 'merge_group'
164+
# ---- PR fast-path: skip heavy E2E on pull requests ----
165+
- name: Skip full E2E on pull requests
166+
if: github.event_name == 'pull_request'
167167
run: |
168-
echo "::notice::Skipping full E2E on ${GITHUB_EVENT_NAME}; runs in merge queue only."
168+
echo "::notice::Skipping full E2E on ${GITHUB_EVENT_NAME}; runs in merge queue and on push to main."
169169
170-
# ---- Merge-queue: full CNPG + Templates E2E ----
170+
# ---- Full CNPG + Templates E2E (merge queue + push) ----
171171
- name: Checkout
172-
if: github.event_name == 'merge_group'
172+
if: github.event_name != 'pull_request'
173173
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
174174
with:
175175
persist-credentials: false
176176

177177
- name: Setup Go
178-
if: github.event_name == 'merge_group'
178+
if: github.event_name != 'pull_request'
179179
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
180180
with:
181181
go-version-file: go.mod
182182
cache: true
183183

184184
- name: Create Kind cluster
185-
if: github.event_name == 'merge_group'
185+
if: github.event_name != 'pull_request'
186186
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
187187
with:
188188
cluster_name: e2e
189189

190190
- name: Build binary
191-
if: github.event_name == 'merge_group'
191+
if: github.event_name != 'pull_request'
192192
env:
193193
GOFLAGS: -mod=vendor
194194
CGO_ENABLED: "0"
@@ -197,78 +197,78 @@ jobs:
197197
run: go build -o coder-k8s ./
198198

199199
- name: Build and load image
200-
if: github.event_name == 'merge_group'
200+
if: github.event_name != 'pull_request'
201201
run: |
202202
docker build -f Dockerfile.goreleaser -t ghcr.io/coder/coder-k8s:e2e .
203203
kind load docker-image ghcr.io/coder/coder-k8s:e2e --name e2e
204204
205205
- name: Apply namespace, CRDs, and RBAC
206-
if: github.event_name == 'merge_group'
206+
if: github.event_name != 'pull_request'
207207
run: |
208208
kubectl apply -f config/e2e/namespace.yaml
209209
kubectl apply -f config/crd/bases/
210210
kubectl apply -f config/rbac/
211211
212212
- name: Enable aggregated API server
213-
if: github.event_name == 'merge_group'
213+
if: github.event_name != 'pull_request'
214214
run: |
215215
kubectl apply -f deploy/apiserver-service.yaml
216216
kubectl apply -f deploy/apiserver-apiservice.yaml
217217
218218
- name: Deploy coder-k8s (controller + aggregated API server)
219-
if: github.event_name == 'merge_group'
219+
if: github.event_name != 'pull_request'
220220
run: kubectl apply -f config/e2e/deployment.yaml
221221

222222
- name: Wait for operator and APIService
223-
if: github.event_name == 'merge_group'
223+
if: github.event_name != 'pull_request'
224224
run: |
225225
kubectl wait --for=condition=Available deploy/coder-k8s -n coder-system --timeout=120s
226226
kubectl wait --for=condition=Available apiservice/v1alpha1.aggregation.coder.com --timeout=180s
227227
228228
- name: Install CloudNativePG operator
229-
if: github.event_name == 'merge_group'
229+
if: github.event_name != 'pull_request'
230230
run: |
231231
kubectl apply --server-side -f https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/release-1.25/releases/cnpg-1.25.0.yaml
232232
kubectl wait --for=condition=Available deploy/cnpg-controller-manager -n cnpg-system --timeout=180s
233233
234234
- name: Provision PostgreSQL and CoderControlPlane
235-
if: github.event_name == 'merge_group'
235+
if: github.event_name != 'pull_request'
236236
run: kubectl apply -f examples/cloudnativepg/
237237

238238
- name: Wait for PostgreSQL
239-
if: github.event_name == 'merge_group'
239+
if: github.event_name != 'pull_request'
240240
run: kubectl -n coder wait --for=condition=Ready cluster/coder-db --timeout=600s
241241

242242
- name: Wait for Coder deployment
243-
if: github.event_name == 'merge_group'
243+
if: github.event_name != 'pull_request'
244244
run: kubectl -n coder rollout status deployment/coder --timeout=600s
245245

246246
- name: Wait for CoderControlPlane readiness
247-
if: github.event_name == 'merge_group'
247+
if: github.event_name != 'pull_request'
248248
run: |
249249
kubectl -n coder wait --for=jsonpath='{.status.phase}'=Ready codercontrolplane/coder --timeout=600s
250250
kubectl -n coder wait --for=jsonpath='{.status.operatorAccessReady}'=true codercontrolplane/coder --timeout=600s
251251
252252
- name: Verify operator token secret
253-
if: github.event_name == 'merge_group'
253+
if: github.event_name != 'pull_request'
254254
run: |
255255
TOKEN_SECRET=$(kubectl -n coder get codercontrolplane coder -o jsonpath='{.status.operatorTokenSecretRef.name}')
256256
test -n "$TOKEN_SECRET"
257257
kubectl -n coder get secret "$TOKEN_SECRET"
258258
259259
- name: Create CoderTemplate via kubectl
260-
if: github.event_name == 'merge_group'
260+
if: github.event_name != 'pull_request'
261261
run: kubectl apply -f config/e2e/codertemplate.yaml
262262

263263
- name: Verify CoderTemplate exists
264-
if: github.event_name == 'merge_group'
264+
if: github.event_name != 'pull_request'
265265
run: |
266266
kubectl -n coder get codertemplates
267267
kubectl -n coder get codertemplate default.e2e-template -o yaml
268268
269269
# ---- Failure diagnostics ----
270270
- name: Dump cluster state on failure
271-
if: failure() && github.event_name == 'merge_group'
271+
if: failure() && github.event_name != 'pull_request'
272272
run: |
273273
echo "=== Pods (all namespaces) ==="
274274
kubectl get pods -A || true

0 commit comments

Comments
 (0)