-
Notifications
You must be signed in to change notification settings - Fork 53
123 lines (107 loc) · 4.17 KB
/
ci-e2e-checks.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
name: e2e-checks
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
e2e-tests:
runs-on: ubuntu-latest
strategy:
matrix:
k8s-version:
- v1.27
- v1.26
- v1.25
- v1.24
include:
- k8s-version: v1.27
kind-node-image: kindest/node:v1.27.3@sha256:3966ac761ae0136263ffdb6cfd4db23ef8a83cba8a463690e98317add2c9ba72
- k8s-version: v1.26
kind-node-image: kindest/node:v1.26.6@sha256:6e2d8b28a5b601defe327b98bd1c2d1930b49e5d8c512e1895099e4504007adb
- k8s-version: v1.25
kind-node-image: kindest/node:v1.25.11@sha256:227fa11ce74ea76a0474eeefb84cb75d8dad1b08638371ecf0e86259b35be0c8
- k8s-version: v1.24
kind-node-image: kindest/node:v1.24.15@sha256:7db4f8bea3e14b82d12e044e25e34bd53754b7f2b0e9d56df21774e6f66a70ab
name: e2e-tests for K8s ${{ matrix.k8s-version }}
steps:
- name: Check out the repo
uses: actions/checkout@v2
# Collect Release SHA Tag is used to to collect information needed later in the action and expose it so it can be referenced
- name: Collect Release SHA Tag
id: prep
run: |
echo ::set-output name=releasetag::sha-${GITHUB_SHA::7}
# Part of docker/build-push-action@v2; setting up the build system
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
driver: docker-container
driver-opts: image=moby/buildkit:buildx-stable-1
use: true
- name: Build imageswap-init Container Image
timeout-minutes: 10
uses: docker/build-push-action@v2
with:
context: ./app/imageswap-init/
# file should be specified relative to the repo root rather than relative to the context
file: ./app/imageswap-init/Dockerfile
# Don't push the image to a registry
push: false
# Load image into local docker default context
outputs: type=docker
# Uses the releasetag output exposed by the Collect Release SHA Tag step to set the tag under v2
tags: thewebroot/imageswap-init:${{ steps.prep.outputs.releasetag }}
- name: Build imageswap Container Image
timeout-minutes: 10
uses: docker/build-push-action@v2
with:
context: ./app/imageswap/
# file should be specified relative to the repo root rather than relative to the context
file: ./app/imageswap/Dockerfile
# Don't push the image to a registry
push: false
# Load image into local docker default context
outputs: type=docker
# Uses the releasetag output exposed by the Collect Release SHA Tag step to set the tag under v2
tags: thewebroot/imageswap:${{ steps.prep.outputs.releasetag }}
- name: Setup KinD Cluster
timeout-minutes: 10
uses: engineerd/[email protected]
with:
version: "v0.20.0"
image: ${{ matrix.kind-node-image }}
wait: 360s
- name: Install ImageSwap
timeout-minutes: 10
run: |
echo "Loading ImageSwap images to KinD nodes"
GIT_SHA=${{github.sha}}
kind load docker-image thewebroot/imageswap-init:sha-${GIT_SHA::7}
kind load docker-image thewebroot/imageswap:sha-${GIT_SHA::7}
echo "Updating target image to use local ref"
sed -i='' -E "s/(IMAGESWAP_VERSION := )(.*$)/\1sha-${GIT_SHA::7}/" Makefile
sed -i='' -E "s/(IMAGESWAP_INIT_VERSION := )(.*$)/\1sha-${GIT_SHA::7}/" Makefile
sed -i='' -E 's/(imagePullPolicy:) Always/\1 IfNotPresent/' deploy/manifests/imageswap-deploy.yaml
make set-release-version
make build-single-manifest
echo "Install ImageSwap"
make install
kubectl wait --for=condition=Ready pods -l app=imageswap -n imageswap-system
- name: Configure Test Namespace
timeout-minutes: 5
run: |
make ns-create-test
- name: Install Tools
timeout-minutes: 5
run: |
sudo add-apt-repository ppa:rmescandon/yq
sudo apt update
sudo apt install yq -y
yq --version
- name: Execute Functional Tests
timeout-minutes: 5
run: |
make test-functional