-
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.23
- v1.22
- v1.21
- v1.20
include:
- k8s-version: v1.23
kind-node-image: kindest/node:v1.23.4@sha256:0e34f0d0fd448aa2f2819cfd74e99fe5793a6e4938b328f657c8e3f81ee0dfb9
- k8s-version: v1.22
kind-node-image: kindest/node:v1.22.7@sha256:1dfd72d193bf7da64765fd2f2898f78663b9ba366c2aa74be1fd7498a1873166
- k8s-version: v1.21
kind-node-image: kindest/node:v1.21.10@sha256:84709f09756ba4f863769bdcabe5edafc2ada72d3c8c44d6515fc581b66b029c
- k8s-version: v1.20
kind-node-image: kindest/node:v1.20.15@sha256:393bb9096c6c4d723bb17bceb0896407d7db581532d11ea2839c80b28e5d8deb
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/setup-kind@v0.5.0
with:
version: "v0.12.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