-
Notifications
You must be signed in to change notification settings - Fork 15
147 lines (138 loc) · 4.65 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
140
141
142
143
144
145
146
147
---
name: E2E
run-name: Running E2E for ${{ inputs.cloud }} (${{ github.ref_name }})
on:
workflow_call:
inputs:
cloud:
default: aws
required: false
type: string
use_helm:
default: false
required: false
type: boolean
version:
default: ci
required: false
type: string
workflow_dispatch:
inputs:
cloud:
description: Cloud to run against
required: false
default: "aws"
type: choice
options:
- aws
- azurerm
- google
use_helm:
description: Indicates we install the controller via official helm chart
required: false
type: boolean
default: false
version:
description: Version of controller to check against
required: false
default: ci
jobs:
controller-image:
if: (github.event.inputs || inputs).version == 'ci'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build
uses: docker/[email protected]
with:
context: .
file: images/Dockerfile.controller
tags: ghcr.io/appvia/terranetes-controller:ci
outputs: type=docker,dest=/tmp/controller-image.tar
- name: Save
uses: actions/upload-artifact@v4
with:
name: controller-image-${{ github.run_id }}-${{ (github.event.inputs || inputs).cloud }}
path: /tmp/controller-image.tar
retention-days: 1
executor-image:
if: (github.event.inputs || inputs).version == 'ci'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build
uses: docker/[email protected]
with:
context: .
file: images/Dockerfile.executor
tags: ghcr.io/appvia/terranetes-executor:ci
outputs: type=docker,dest=/tmp/executor-image.tar
- name: Save
uses: actions/upload-artifact@v4
with:
name: executor-image-${{ github.run_id }}-${{ (github.event.inputs || inputs).cloud }}
path: /tmp/executor-image.tar
retention-days: 1
e2e:
if: always()
needs:
- controller-image
- executor-image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Requirements
run: |
sudo apt update -y
sudo apt install bats jq
- name: Install Kubectl
uses: azure/setup-kubectl@v4
with:
version: v1.28.0
- name: Install Kind
run: |
curl -sL https://github.com/kubernetes-sigs/kind/releases/download/v0.20.0/kind-linux-amd64 -o kind
chmod +x kind
kind create cluster
- name: Retrieve Controller Image
if: (github.event.inputs || inputs).version == 'ci'
uses: actions/download-artifact@v4
with:
name: controller-image-${{ github.run_id }}-${{ (github.event.inputs || inputs).cloud }}
path: /tmp
- name: Retrieve Executor Image
if: (github.event.inputs || inputs).version == 'ci'
uses: actions/download-artifact@v4
with:
name: executor-image-${{ github.run_id }}-${{ (github.event.inputs || inputs).cloud }}
path: /tmp
- name: Load images
if: (github.event.inputs || inputs).version == 'ci'
run: |
kind load image-archive /tmp/controller-image.tar
kind load image-archive /tmp/executor-image.tar
- name: Running E2E
run: |
test/e2e/check-suite.sh \
--cloud ${{ (github.event.inputs || inputs).cloud }} \
--use-chart ${{ (github.event.inputs || inputs).use_helm }} \
--version ${{ (github.event.inputs || inputs).version }}
env:
ARM_CLIENT_ID: ${{ secrets.E2E_ARM_CLIENT_ID }}
ARM_CLIENT_SECRET: ${{ secrets.E2E_ARM_CLIENT_SECRET }}
ARM_SUBSCRIPTION_ID: ${{ secrets.E2E_ARM_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.E2E_ARM_TENANT_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.E2E_AWS_ACCESS_KEY_ID }}
AWS_REGION: ${{ secrets.E2E_AWS_REGION }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.E2E_AWS_SECRET_ACCESS_KEY }}
DIAGNOSTICS: ${{ secrets.DIAGNOSTICS }}
E2E_SSH_DEPLOYMENT_KEY: ${{ secrets.E2E_SSH_DEPLOYMENT_KEY }}
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
INFRACOST_API_KEY: ${{ secrets.INFRACOST_API_KEY }}