-
-
Notifications
You must be signed in to change notification settings - Fork 1
194 lines (192 loc) · 5.82 KB
/
regression.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
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
name: Rete QA Regression
run-name: Rete QA for ${{ inputs.name }} v${{ inputs.version }} (${{ inputs.qa }}, ${{ inputs.kit }} ${{ inputs.deps || '' }})
on:
workflow_call:
inputs:
name:
required: true
type: string
version:
required: true
type: number
node:
type: number
qa:
type: string
default: 'rete-qa@latest'
kit:
type: string
default: 'rete-kit@latest'
deps:
type: string
default: ''
workflow_dispatch:
inputs:
name:
required: true
type: choice
description: Stack
options:
- react
- vue
- angular
- svelte
version:
required: true
type: number
description: Stack version
node:
type: number
description: 'Node.js version (default: 16)'
qa:
description: 'Rete QA (<name>@<version> or <owner>/<repo>#<version>)'
type: string
default: 'rete-qa@latest'
kit:
description: 'Rete Kit (<name>@<version> or <owner>/<repo>#<version>)'
type: string
default: 'rete-kit@latest'
deps:
description: 'List of dependencies (<owner>/<repo>#<version>, comma separated)'
type: string
default: ''
jobs:
tools:
name: Prepare tools
uses: ./.github/workflows/prepare-qa-kit.yml
secrets: inherit
with:
qa: ${{ inputs.qa }}
kit: ${{ inputs.kit }}
deps:
name: Prepare alias deps
if: inputs.deps
uses: ./.github/workflows/prepare-deps.yml
secrets: inherit
with:
repos: ${{ inputs.deps }}
init:
name: Initialize ${{ inputs.name }} v${{ inputs.version }} app
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [tools,deps]
if: |
always() &&
!contains(needs.*.result, 'failure') &&
!contains(needs.*.result, 'cancelled')
steps:
- uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node || 16 }}
- name: Cache global node modules
id: cache-npm
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-${{ inputs.node || 16 }}-cache-global-node-modules
- name: Download artifact with Rete QA
uses: actions/download-artifact@v4
if: needs.tools.outputs.qa-artifact
with:
name: ${{ needs.tools.outputs.qa-artifact }}
path: .
- name: Download artifact with Rete Kit
uses: actions/download-artifact@v4
if: needs.tools.outputs.kit-artifact
with:
name: ${{ needs.tools.outputs.kit-artifact }}
path: .
- name: Download deps
uses: actions/download-artifact@v4
if: inputs.deps
with:
name: deps
path: .
- name: Install Rete QA
run: npm i -g ${{ needs.tools.outputs.qa-path }} ${{ needs.tools.outputs.kit-path }}
- name: Init application
run: rete-qa init -s ${{ inputs.name }} -sv ${{ inputs.version }} ${{ inputs.deps && '--deps-alias deps.json' || '' }}
env:
CI: ""
- name: Prune node_modules
run: npx rimraf --glob **/node_modules
working-directory: .rete-qa
- uses: actions/upload-artifact@v4
with:
name: rete-qa-${{ inputs.name }}-v${{ inputs.version }}
path: .rete-qa
retention-days: 3
test:
name: ${{ matrix.browser }}
timeout-minutes: 60
runs-on: ubuntu-latest
needs: [init,tools]
if: |
always() &&
!contains(needs.*.result, 'failure') &&
!contains(needs.*.result, 'cancelled')
strategy:
fail-fast: false
matrix:
browser: [chromium,firefox,webkit]
steps:
- name: Install fonts
run: |
sudo apt-get -qqy update
sudo apt-get -qqy --no-install-recommends install \
libfontconfig \
libfreetype6 \
xfonts-cyrillic \
xfonts-scalable \
fonts-liberation \
fonts-ipafont-gothic \
fonts-wqy-zenhei \
fonts-tlwg-loma-otf \
fonts-freefont-ttf
sudo rm -rf /var/lib/apt/lists/*
sudo apt-get -qyy clean
- uses: actions/download-artifact@v4
with:
name: rete-qa-${{ inputs.name }}-v${{ inputs.version }}
path: .rete-qa
- uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node || 16 }}
- name: Cache global node modules
id: cache-npm
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-${{ inputs.node || 16 }}-cache-global-node-modules
- name: Download artifact with Rete QA
uses: actions/download-artifact@v4
if: needs.tools.outputs.qa-artifact
with:
name: ${{ needs.tools.outputs.qa-artifact }}
path: .
- name: Download artifact with Rete Kit
uses: actions/download-artifact@v4
if: needs.tools.outputs.kit-artifact
with:
name: ${{ needs.tools.outputs.kit-artifact }}
path: .
- name: Install Rete QA
run: npm i -g ${{ needs.tools.outputs.qa-path }} ${{ needs.tools.outputs.kit-path }}
- name: Install Playwright Browsers
run: npx playwright install --with-deps ${{ matrix.browser }}
- name: Run Playwright tests
run: rete-qa test -s ${{ inputs.name }} -sv ${{ inputs.version }} --project ${{ matrix.browser }}
env:
REPORTER: '[["github"], ["html", { "open": "never", "outputFolder": "${{ github.workspace }}/report" }]]'
- uses: actions/upload-artifact@v3
if: always()
with:
name: test-results-${{ inputs.name }}-v${{ inputs.version }}-${{ matrix.browser }}
path: test-results/
retention-days: 7
- uses: actions/upload-artifact@v4
if: always()
with:
name: report-${{ inputs.name }}-v${{ inputs.version }}-${{ matrix.browser }}
path: ${{ github.workspace }}/report
retention-days: 7