forked from NVIDIA/aicr
-
Notifications
You must be signed in to change notification settings - Fork 0
153 lines (139 loc) · 5.1 KB
/
Copy pathmirror-e2e.yaml
File metadata and controls
153 lines (139 loc) · 5.1 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
# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# 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.
name: Mirror E2E
on:
push:
branches: [main]
paths:
- 'pkg/mirror/**'
- 'pkg/helm/**'
- 'pkg/defaults/timeouts.go'
- 'pkg/cli/mirror.go'
- 'pkg/cli/mirror_test.go'
- 'recipes/**'
- 'tools/mirror-e2e'
- '.settings.yaml'
- '.github/actions/load-versions/**'
- '.github/workflows/mirror-e2e.yaml'
- '.github/actions/setup-build-tools/**'
- '!**.md'
pull_request:
branches: [main]
paths:
- 'pkg/mirror/**'
- 'pkg/helm/**'
- 'pkg/defaults/timeouts.go'
- 'pkg/cli/mirror.go'
- 'pkg/cli/mirror_test.go'
- 'recipes/**'
- 'tools/mirror-e2e'
- '.settings.yaml'
- '.github/actions/load-versions/**'
- '.github/workflows/mirror-e2e.yaml'
- '.github/actions/setup-build-tools/**'
- '!**.md'
workflow_dispatch: {}
permissions:
contents: read
# PR concurrency: cancel in-progress runs for the same PR
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
test:
name: Mirror E2E
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Load versions
id: versions
uses: ./.github/actions/load-versions
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: ${{ steps.versions.outputs.go }}
cache: false # vendor/ provides deps
- name: Prep runner for Kind
uses: ./.github/actions/prep-kind-runner
- name: Cache tools
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
/usr/local/bin/kind
/usr/local/bin/helm
/usr/local/bin/kubectl
/usr/local/bin/yq
/usr/local/bin/crane
/usr/local/bin/ctlptl
/usr/local/bin/hauler
/usr/local/bin/zarf
key: mirror-e2e-tools-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.settings.yaml') }}
- name: Setup build tools
uses: ./.github/actions/setup-build-tools
with:
install_goreleaser: 'true'
goreleaser_version: '${{ steps.versions.outputs.goreleaser }}'
install_kind: 'true'
kind_version: '${{ steps.versions.outputs.kind }}'
install_helm: 'true'
helm_version: '${{ steps.versions.outputs.helm }}'
install_kubectl: 'true'
kubectl_version: '${{ steps.versions.outputs.kubectl }}'
install_yq: 'true'
yq_version: '${{ steps.versions.outputs.yq }}'
install_crane: 'true'
crane_version: '${{ steps.versions.outputs.crane }}'
install_ctlptl: 'true'
ctlptl_version: '${{ steps.versions.outputs.ctlptl }}'
install_hauler: 'true'
hauler_version: '${{ steps.versions.outputs.hauler }}'
install_zarf: 'true'
zarf_version: '${{ steps.versions.outputs.zarf }}'
- name: Run mirror E2E
env:
GOFLAGS: -mod=vendor
run: |
make mirror-e2e
- name: Collect debug artifacts
if: failure()
run: |
mkdir -p /tmp/mirror-e2e-debug
# Registry catalog
crane catalog localhost:5001 > /tmp/mirror-e2e-debug/registry-catalog.txt 2>&1 || true
# Kind cluster state
for cluster in $(kind get clusters 2>/dev/null); do
kind export kubeconfig --name "$cluster" 2>/dev/null || continue
kubectl get all --all-namespaces > "/tmp/mirror-e2e-debug/${cluster}-resources.txt" || true
kubectl get nodes -o wide > "/tmp/mirror-e2e-debug/${cluster}-nodes.txt" || true
done
# Docker state
docker ps -a > /tmp/mirror-e2e-debug/docker-ps.txt 2>&1 || true
- name: Upload debug artifacts
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: mirror-e2e-debug-${{ github.run_id }}
path: /tmp/mirror-e2e-debug/
retention-days: 7
- name: Cleanup
if: always()
run: |
for cluster in $(kind get clusters 2>/dev/null); do
kind delete cluster --name "$cluster" || true
done
docker system prune -f || true