-
Notifications
You must be signed in to change notification settings - Fork 19
213 lines (203 loc) · 6.12 KB
/
ci-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
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
name: "[ci]: E2E"
on:
pull_request:
jobs:
start-vm:
name: Start VM
runs-on: ubuntu-latest
outputs:
label: ${{ steps.start-yc-runner.outputs.label }}
instance-id: ${{ steps.start-yc-runner.outputs.instance-id }}
steps:
- name: Start YC runner
id: start-yc-runner
uses: yc-actions/yc-github-runner@v1
with:
mode: start
yc-sa-json-credentials: ${{ secrets.YC_SA_JSON_CREDENTIALS }}
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
folder-id: b1gcvl619mdunf1cqqbv
image-id: fd8q5h7f9c5lpd474h12
zone-id: "ru-central1-b"
subnet-id: e2lno1rkqo63l729dlo7
cores: 4
memory: 16GB
core-fraction: 100
disk-type: network-ssd-nonreplicated
disk-size: 93GB
public-ip: false
e2e-build:
name: Build docker image
runs-on: ${{ needs.start-vm.outputs.label }}
needs: start-vm
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Build UI
run: |
pwd
cd packages/ui
npm run docker:build --dockertag=local
IMAGE_NAME=$(npm run -s show:docker-image-name)
STABLE_IMAGE_NAME=$(echo $IMAGE_NAME | sed s/-nightly$//g)
docker tag $IMAGE_NAME:local $STABLE_IMAGE_NAME:local
run-local-cluster-sh:
name: Install run_local_cluster.sh
runs-on: ${{ needs.start-vm.outputs.label }}
needs:
- start-vm
- e2e-build
steps:
- name: install
run: |
curl https://raw.githubusercontent.com/ytsaurus/ytsaurus/main/yt/docker/local/run_local_cluster.sh > run_local_cluster.sh
chmod a+x run_local_cluster.sh
install run_local_cluster.sh /usr/local/bin
e2e-local:
name: E2E for 'Local'
runs-on: ${{ needs.start-vm.outputs.label }}
needs:
- start-vm
- e2e-build
- run-local-cluster-sh
steps:
- name: Run containers for 'Local'
run: |
run_local_cluster.sh --node-count 2 --ui-skip-pull true --ui-version local --yt-version stable --ui-app-installation e2e
sleep 10
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: "18.x"
cache: "npm"
- name: npm ci
run: |
cd packages/ui/tests
npm ci
- name: Install browsers
run: |
cd packages/ui/tests
npx playwright install chromium
- name: Init YT local
run: |
cd packages/ui
YT_PROXY=`hostname`:8000 npm run e2e:localmode:init
- name: E2E for 'Local'
run: |
cd packages/ui
npm run e2e:localmode:ui
- name: Upload local test-results
uses: actions/upload-artifact@v4
if: failure()
with:
name: local_test-results
path: packages/ui/tests/test-results/
retention-days: 7
e2e-local-as-remote:
name: E2E for 'Local as remote'
runs-on: ${{ needs.start-vm.outputs.label }}
needs:
- start-vm
- e2e-build
- e2e-local
- run-local-cluster-sh
steps:
- name: Run containers for 'Local as remote'
run: |
run_local_cluster.sh --stop
run_local_cluster.sh --node-count 2 --ui-skip-pull true --ui-version local --yt-version stable --ui-app-installation e2e --docker-hostname `hostname` --fqdn localhost --ui-network bridge
sleep 10
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: "18.x"
cache: "npm"
- name: npm ci
run: |
cd packages/ui/tests
npm ci
- name: Tests for 'Local as remote'
run: |
cd packages/ui
YT_PROXY=`hostname`:8000 npm run e2e:localmode:init
npm run e2e:localmode:remote
- name: Upload local test-results
uses: actions/upload-artifact@v4
if: failure()
with:
name: remote_test-results
path: packages/ui/tests/test-results/
retention-days: 7
e2e-screenshots:
name: E2E-screenshots for 'Local'
runs-on: ${{ needs.start-vm.outputs.label }}
needs:
- start-vm
- e2e-build
- e2e-local
- e2e-local-as-remote
- run-local-cluster-sh
steps:
- name: Run containers for 'Local'
run: |
run_local_cluster.sh --stop
run_local_cluster.sh --node-count 2 --ui-skip-pull true --ui-version local --yt-version stable --ui-app-installation e2e
sleep 10
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: "18.x"
cache: "npm"
- name: npm ci
run: |
cd packages/ui/tests
npm ci
- name: Install browsers
run: |
cd packages/ui/tests
npx playwright install chromium
- name: Init YT local
run: |
cd packages/ui
YT_PROXY=`hostname`:8000 npm run e2e:localmode:init
- name: Screenshot tests for 'Local'
run: |
cd packages/ui
npm run e2e:localmode:screenshots
- name: Upload local test-results
uses: actions/upload-artifact@v4
if: failure()
with:
name: screenshots_test-results
path: packages/ui/tests/test-results/
retention-days: 7
stop-vm:
name: Stop VM
needs:
- start-vm
- e2e-screenshots
runs-on: ubuntu-latest
if: ${{ always() }}
steps:
- name: Stop YC runner
uses: yc-actions/yc-github-runner@v1
with:
mode: stop
yc-sa-json-credentials: ${{ secrets.YC_SA_JSON_CREDENTIALS }}
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
label: ${{ needs.start-vm.outputs.label }}
instance-id: ${{ needs.start-vm.outputs.instance-id }}