-
Notifications
You must be signed in to change notification settings - Fork 275
130 lines (125 loc) · 4.11 KB
/
Copy pathe2e-fleet-upgrade-ci.yml
File metadata and controls
130 lines (125 loc) · 4.11 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
# Upgrade Fleet standalone from latest released to dev version
name: E2E Upgrade Fleet Standalone to HEAD
on:
schedule:
- cron: '0 8 */2 * *'
pull_request:
env:
GOARCH: amd64
CGO_ENABLED: 0
SETUP_K3D_VERSION: 'v5.8.3'
jobs:
fleet-upgrade-test:
runs-on: ubuntu-latest
strategy:
matrix:
k3s:
- name: k3s-new
version: v1.33.1-k3s1
name: fleet-upgrade-test-${{ matrix.k3s.name }}
steps:
-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
with:
go-version-file: 'go.mod'
check-latest: true
-
name: Install Ginkgo CLI
run: go install github.com/onsi/ginkgo/v2/ginkgo
-
name: Determine cache key
id: cache-key
run: |
DAY_OF_YEAR=$(date +%j)
if [ $(($DAY_OF_YEAR % 28)) -eq 0 ]; then
echo "value=$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT
else
echo "value=latest" >> $GITHUB_OUTPUT
fi
-
name: Cache crust-gather CLI
id: cache-crust
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: ~/.local/bin/crust-gather
key: ${{ runner.os }}-crust-gather-${{ steps.cache-key.outputs.value }}
restore-keys: |
${{ runner.os }}-crust-gather-
-
name: Install crust-gather CLI
run: |
if [ "${{ steps.cache-crust.outputs.cache-hit }}" != "true" ]; then
echo "Cache not found, downloading from source"
mkdir -p ~/.local/bin
if curl -sSfL https://github.com/crust-gather/crust-gather/raw/main/install.sh | sh -s -- --yes; then
# Cache the binary for future runs
if [ ! -f ~/.local/bin/crust-gather ]; then
which crust-gather && cp $(which crust-gather) ~/.local/bin/
fi
else
echo "Failed to download crust-gather"
exit 1
fi
else
echo "Using cached crust-gather CLI"
chmod +x ~/.local/bin/crust-gather
sudo ln -sf ~/.local/bin/crust-gather /usr/local/bin/
fi
-
name: Install k3d
run: curl --silent --fail https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | TAG=${{ env.SETUP_K3D_VERSION }} bash
-
name: Provision k3d Cluster
run: |
k3d cluster create upstream --wait \
--agents 1 \
--network "nw01" \
--image docker.io/rancher/k3s:${{matrix.k3s.version}}
-
name: Deploy Latest Release
run: |
./.github/scripts/deploy-fleet-latest-release.sh
-
name: Create example workload
run: |
kubectl apply -n fleet-local -f e2e/assets/installation/simple.yaml
-
name: Build Fleet Binaries
run: |
./.github/scripts/build-fleet-binaries.sh
-
name: Build Docker Images
run: |
./.github/scripts/build-fleet-images.sh
-
name: Import Images Into k3d
run: |
./.github/scripts/k3d-import-retry.sh rancher/fleet:dev rancher/fleet-agent:dev -c upstream
-
name: Verify Example Workload
run: |
# we waited long enough by importing the image first
kubectl get configmap -n simple-example | grep -q -m 1 "simple-config"
-
name: Upgrade to Dev Version
run: |
./.github/scripts/deploy-fleet.sh
-
name: Verify Installation
env:
FLEET_E2E_NS: fleet-local
run: |
ginkgo --github-output --trace --label-filter="!multi-cluster" e2e/installation
-
name: Upload Logs
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: failure()
with:
name: gha-fleet-e2e-logs-${{ github.sha }}-${{ matrix.k3s.version }}-${{ github.run_id }}
path: |
tmp/upstream
retention-days: 2