-
Notifications
You must be signed in to change notification settings - Fork 2
187 lines (167 loc) · 5.8 KB
/
master_std_ui.yml
File metadata and controls
187 lines (167 loc) · 5.8 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# This workflow is a reusable one called by other workflows
name: STD UI template
on:
workflow_call:
# Variables to set when calling this reusable workflow
inputs:
browser:
description: Web browser to test
required: true
type: string
cypress_docker:
description: Cypress docker image to use
required: true
type: string
cypress_spec:
description: Which Cypress test to execute
required: true
type: string
docker_options:
description: Set other docker options
required: false
type: string
ext_reg:
description: Enable external registry test
required: false
type: string
s3:
description: Enable external s3
required: false
type: string
jobs:
E2E-Cypress:
runs-on: ui-e2e
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.EPINIO_DOCKER_USER }}
password: ${{ secrets.EPINIO_DOCKER_PASSWORD }}
- name: Checkout Epinio repository
uses: actions/checkout@v3
with:
repository: epinio/epinio
submodules: recursive
fetch-depth: 0
path: epinio
- name: Checkout Rancher Dashboard repository
uses: actions/checkout@v3
with:
repository: rancher/dashboard
ref: epinio-dev
path: dashboard
- name: Checkout Epinio UI-backend repository
uses: actions/checkout@v3
with:
repository: epinio/ui-backend
path: ui-backend
- name: Setup Go
uses: actions/setup-go@v4
env:
SETUP_GO_VERSION: '^1.20'
with:
go-version: ${{ env.SETUP_GO_VERSION }}
cache: false
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16.2.0
- name: Cache Tools
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/tools
key: ${{ runner.os }}-tools
- name: Add Tools to PATH
run: |
echo $PATH
echo "`pwd`/output/bin" >> $GITHUB_PATH
- name: Install K3s / Helm / Epinio
id: installation
env:
KUBECONFIG: /etc/rancher/k3s/k3s.yaml
HELM_VERSION: 3.12.0
K3S_VERSION: v1.25.9+k3s1
EXT_REG: ${{ inputs.ext_reg }}
S3: ${{ inputs.s3 }}
EXT_REG_USER: ${{ secrets.EPINIO_DOCKER_USER }}
EXT_REG_PASSWORD: ${{ secrets.EPINIO_DOCKER_PASSWORD }}
GHCR_USER: ${{ secrets.GHCR_USER }}
GHCR_PASSWORD: ${{ secrets.GHCR_PASSWORD }}
S3_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
S3_KEY_SECRET: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# EXTRAENV_NAME: SESSION_KEY
# EXTRAENV_VALUE: 12345
run: |
export PATH=$PATH:/usr/local/bin
ETH_DEV=$(ip route | awk '/default via / { print $5 }')
MY_IP=$(ip a s ${ETH_DEV} | egrep -o 'inet [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | cut -d' ' -f2)
export MY_HOSTNAME=$(hostname)
export EPINIO_SYSTEM_DOMAIN="${MY_IP}.omg.howdoi.website"
echo "MY_IP=${MY_IP}" >> $GITHUB_OUTPUT
make prepare-e2e-ci-standalone
- name: Patch epinio-ui with latest QA image
env:
KUBECONFIG: /etc/rancher/k3s/k3s.yaml
run: |
make patch-epinio-ui
- name: Start Cypress tests
env:
BROWSER: ${{ inputs.browser }}
CYPRESS_CFG: cypress.config.ts
CYPRESS_DOCKER: ${{ inputs.cypress_docker }}
DOCKER_OPTIONS: ${{ inputs.docker_options }}
EXT_REG_USER: ${{ secrets.EPINIO_DOCKER_USER }}
EXT_REG_PASSWORD: ${{ secrets.EPINIO_DOCKER_PASSWORD }}
RANCHER_PASSWORD: password
RANCHER_URL: https://epinio.${{ steps.installation.outputs.MY_IP }}.omg.howdoi.website
RANCHER_USER: admin
SPEC: ${{ inputs.cypress_spec }}
SYSTEM_DOMAIN: ${{ steps.installation.outputs.MY_IP }}.omg.howdoi.website
run: |
ETH_DEV=$(ip route | awk '/default via / { print $5 }')
MY_IP=$(ip a s ${ETH_DEV} | egrep -o 'inet [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | cut -d' ' -f2)
export EPINIO_SYSTEM_DOMAIN="${MY_IP}.omg.howdoi.website"
make start-cypress-tests
- name: Copying screenshots and videos to Mochawesome report
if: always()
run: |
sudo mkdir -p mochawesome-report
sudo cp -r cypress/screenshots mochawesome-report || echo "No screenshots found in this run, probably all tests were OK"
# sudo cp -r cypress/videos mochawesome-report
- name: Upload Cypress screenshots
uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
retention-days: 7
# Test run video was always captured, so this action uses "always()" condition
# - name: Upload Cypress videos
# uses: actions/upload-artifact@v3
# if: always()
# with:
# name: cypress-videos
# path: cypress/videos
# retention-days: 7
- name: Upload Mochawesome report
uses: actions/upload-artifact@v3
if: always()
with:
name: mochawesome-report
path: mochawesome-report
retention-days: 7
- name: Uninstall Epinio
if: always()
env:
KUBECONFIG: /etc/rancher/k3s/k3s.yaml
run: |
make uninstall-epinio
- name: Delete k3s cluster
if: always()
run: |
make clean-k3s
- name: Clean all
if: always()
uses: colpal/actions-clean@v1