Repository navigation
108 lines (100 loc) · 3.25 KB
/
Copy pathlive-e2e.yml
File metadata and controls
108 lines (100 loc) · 3.25 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
# Copyright 2021, 2026 The kpt Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Live Apply Tests using go test framework.
#
# Do not use workflow-level paths-ignore for required checks.
# GitHub leaves skipped required workflows Pending forever.
# Instead, we always run the workflow and skip individual jobs conditionally.
name: Live Apply
on:
pull_request:
push:
branches-ignore:
- 'dependabot/**'
jobs:
# Detect which path groups changed to conditionally skip expensive jobs.
changes:
name: detect changes
runs-on: ubuntu-latest
outputs:
live: ${{ steps.filter.outputs.live }}
steps:
- uses: actions/checkout@v6
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
live:
- 'api/**'
- 'cli/live/**'
- 'cli/pkg/**'
- 'e2e/framework/**'
- 'e2e/live/**'
- 'pkg/**'
- 'go.mod'
- 'go.sum'
- '.github/workflows/live-e2e.yml'
live-apply:
name: live-apply-k8s${{ matrix.k8s }}
needs: changes
if: needs.changes.outputs.live == 'true'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- k8s: "1.35"
version: "1.35.5@sha256:ce977ae6d65918d0b58a5f8b5e940429c2ce42fa3a5619ec2bbc60b949c0ac95"
- k8s: "1.36"
version: "1.36.1@sha256:3489c7674813ba5d8b1a9977baea8a6e553784dab7b84759d1014dbd78f7ebd5"
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Install Kind
uses: helm/kind-action@v1
with:
version: v0.32.0
install_only: true
- name: Run Tests
env:
K8S_VERSION: ${{ matrix.version }}
run: |
K8S_VERSION=$K8S_VERSION make test-live-apply
live-apply-gate:
name: live-apply
needs: [changes, live-apply]
if: always()
runs-on: ubuntu-latest
steps:
- name: Check results
run: |
# If no live changes, this check is not applicable, pass.
if [ "${{ needs.changes.result }}" != "success" ]; then
echo "changes job did not succeed"
exit 1
fi
if [ "${{ needs.changes.outputs.live }}" = "false" ]; then
echo "No live changes, skipping Live Apply tests"
exit 0
fi
# If any required job did not succeed, fail this check.
if [ "${{ needs.live-apply.result }}" != "success" ]; then
echo "Live Apply tests failed or did not complete"
exit 1
fi
echo "Live Apply tests passed"