-
Notifications
You must be signed in to change notification settings - Fork 29
129 lines (112 loc) · 3.78 KB
/
frontend-test.yml
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
name: Frontend Test
on:
push:
paths-ignore:
- "rst/**"
- ".github/workflows/*-translation.yml"
workflow_dispatch:
env:
CMAKE_DUMMY_WEBUI: false
jobs:
webui-test:
strategy:
fail-fast: false
matrix:
script:
- frontend
- cypress
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "16.8.0"
- uses: tarantool/setup-tarantool@v3
with:
tarantool-version: "2.6"
- name: Setup tt
run: |
curl -L https://tarantool.io/release/2/installer.sh | sudo bash
sudo apt install -y tt
tt version
##################################################################
# Setup rocks
- name: Cache rocks
uses: actions/cache@v4
id: cache-rocks
with:
path: .rocks/
key: webui-rocks-${{ hashFiles('*.rockspec') }}-03
- run: tt rocks install luatest 1.0.1
if: steps.cache-rocks.outputs.cache-hit != 'true'
##################################################################
# Cachce node_modules
- name: Cache node_modules
uses: actions/cache@v4
with:
path: webui/node_modules/
key: node-modules-${{ hashFiles('webui/package-lock.json') }}
##################################################################
# Cachce webui bundle
- name: Cache webui bundle
uses: actions/cache@v4
with:
path: |
webui/build/bundle.lua
webui/build/bundle.md5
key: webui-bundle
##################################################################
# Cache cypress
- run: echo node_modules/.bin/ >> $GITHUB_PATH
- name: Cache cypress
if: matrix.script == 'cypress'
id: cache-cypress
uses: actions/cache@v4
with:
path: |
./node_modules
~/.cache/Cypress
key: cypress-7.7.0-${{ runner.os }}-02
- run: |
npm install [email protected]
npx cypress verify
if: >
matrix.script == 'cypress' &&
steps.cache-cypress.outputs.cache-hit != 'true'
##################################################################
- run: tt rocks make
# Stop Mono server. This server starts and listens to 8084 port that is
# used for tests.
- name: "Stop Mono server"
run: sudo kill -9 $(sudo lsof -t -i tcp:8084) || true
- if: matrix.script == 'frontend'
run: ./frontend-test.sh
- if: matrix.script == 'cypress'
run: ./cypress-test.sh run
- name: Create upload folder for screenshots
uses: actions/upload-artifact@v4
if: failure() && matrix.script == 'cypress'
with:
name: ${{ matrix.script }}-screenshots-from-server
path: webui/cypress/screenshots/
retention-days: 5
if-no-files-found: ignore
- name: Create upload folder for diff outputs
uses: actions/upload-artifact@v4
if: failure() && matrix.script == 'cypress'
with:
name: ${{ matrix.script }}-snapshots-diff-output-from-server
path: webui/cypress/snapshots/**/__diff_output__/**
retention-days: 5
if-no-files-found: ignore
- name: Create upload folder for snapshots
uses: actions/upload-artifact@v4
if: always() && matrix.script == 'cypress'
with:
name: ${{ matrix.script }}-snapshots-from-server
path: webui/cypress/snapshots/
retention-days: 1
if-no-files-found: ignore
##################################################################
# Cleanup cached paths
- run: tt rocks remove cartridge