forked from rancher/elemental-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (136 loc) · 4.7 KB
/
e2e.yaml
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
name: e2e tests
on:
pull_request:
concurrency:
group: e2e-tests=full-${{ github.head_ref || github.ref }}-${{ github.repository }}
cancel-in-progress: true
jobs:
prepare-build:
name: Wait for the PR project to build
runs-on: ubuntu-latest
outputs:
chart_name: ${{ steps.chart.outputs.chart_name }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Wait for OBS crds chart
uses: "./.github/actions/wait-commit-status"
with:
repository: ${{ github.repository }}
commit: ${{ github.event.pull_request.head.sha }}
context: "OBS: elemental-operator-crds-helm - charts/x86_64"
status: "success"
interval: 60
retries: 10
- name: Wait for OBS operator chart
uses: "./.github/actions/wait-commit-status"
with:
repository: ${{ github.repository }}
commit: ${{ github.event.pull_request.head.sha }}
context: "OBS: elemental-operator-helm - charts/x86_64"
status: "success"
interval: 60
retries: 10
- name: Wait for OBS elemental-operator package
uses: "./.github/actions/wait-commit-status"
with:
repository: ${{ github.repository }}
commit: ${{ github.event.pull_request.head.sha }}
context: "OBS: elemental-operator - standard/x86_64"
status: "success"
interval: 60
retries: 30
- name: Wait for OBS seedimage-builder build
uses: "./.github/actions/wait-commit-status"
with:
repository: ${{ github.repository }}
commit: ${{ github.event.pull_request.head.sha }}
context: "OBS: seedimage-builder - containers/x86_64"
status: "success"
interval: 60
retries: 30
- name: Wait for OBS operator-image build
uses: "./.github/actions/wait-commit-status"
with:
repository: ${{ github.repository }}
commit: ${{ github.event.pull_request.head.sha }}
context: "OBS: operator-image - containers/x86_64"
status: "success"
interval: 60
retries: 30
- name: Pull chart for PR
env:
PR_NUMBER: ${{ github.event.number }}
OPERATOR_CHART: rancher/elemental-operator-chart
CRDS_CHART: rancher/elemental-operator-crds-chart
run: |
set -x
B_REPO=registry.opensuse.org/isv/rancher/elemental/pr/rancher/elemental-operator/pr-${PR_NUMBER}/charts
mkdir -p build
helm pull -d build oci://${B_REPO}/${CRDS_CHART}
helm pull -d build oci://${B_REPO}/${OPERATOR_CHART}
- name: Set chart output
id: chart
run: |
set -x
FILE=$(find . -type f -name "elemental-operator-chart-[1-9]*.tgz" -print)
CHART=$(basename $FILE)
echo "chart_name=$CHART" >> $GITHUB_OUTPUT
- name: Upload chart
uses: actions/upload-artifact@v4
with:
name: chart
path: build/*.tgz
overwrite: true
e2e-tests:
strategy:
matrix:
kubernetes: [ "v1.23.17", "v1.24.15", "v1.25.11", "v1.26.6" ]
replicas: ["1"]
rancherVersion : ["2.7.8"]
runs-on: ubuntu-latest
needs: prepare-build
name: k8s ${{ matrix.kubernetes }} - Rancher ${{ matrix.rancherVersion }} - ${{ matrix.replicas }} replicas
env:
CHART: ${{ github.workspace }}/build/${{ needs.prepare-build.outputs.chart_name }}
OPERATOR_REPLICAS: ${{ matrix.replicas }}
RANCHER_VERSION: ${{ matrix.rancherVersion }}
NGINX_VERSION: controller-v1.9.1
CERT_MANAGER_VERSION: v1.13.1
SYSTEM_UPGRADE_CONTROLLER_VERSION: v0.13.1
steps:
- uses: actions/checkout@v4
- name: Download chart
uses: actions/download-artifact@v4
with:
name: chart
path: build
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-test-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-test-go-${{ hashFiles('**/go.sum') }}
- name: Install kind
uses: helm/kind-action@v1
with:
cluster_name: operator-e2e
node_image: kindest/node:${{ matrix.kubernetes }}
- name: e2e tests
run: make e2e-tests
- name: Archive artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: ci-artifacts
path: _artifacts
if-no-files-found: ignore
overwrite: true