forked from fossasia/visdom
-
Notifications
You must be signed in to change notification settings - Fork 0
228 lines (195 loc) · 6.71 KB
/
Copy pathprocess-changes.yml
File metadata and controls
228 lines (195 loc) · 6.71 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
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
name: Test changes
on: pull_request
# push:
# branches:
# - master
jobs:
lint-js:
name: "Javascript Linter Check"
runs-on: ubuntu-latest
steps:
- name: "Checkout Repository"
uses: actions/checkout@v7.0.0
- name: "Install Node"
uses: actions/setup-node@v6.4.0
with:
node-version: '24'
- name: "Install Dependencies"
run: ELECTRON_SKIP_BINARY_DOWNLOAD=1 npm install
- name: "Linter Check (ESLint)"
run: npm run lint
lint-py:
name: "Python Linter Check"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7.0.0
- uses: psf/black@26.5.1
with:
src: "./py"
version: 23.1.0
- name: Check for Linting Errors
if: failure()
run: echo "::warning title='Python Linter Check failed'::Please run \"pip install black; black py\" before committing code changes to python files."
install-and-build:
name: "Install and Build"
runs-on: ubuntu-latest
outputs:
jsfileschanged: ${{ steps.checkout.outputs.jsfileschanged }}
steps:
- name: "Checkout Repository"
uses: actions/checkout@v7.0.0
- uses: ./.github/actions/prepare
with:
loadprbuild: false
# count changed js files (diff to base branch)
- name: "Count changed JS-Files"
id: checkout
run: |
git fetch origin $GITHUB_BASE_REF
echo "Target branch : $GITHUB_BASE_REF"
git diff --name-only origin/$GITHUB_BASE_REF --
echo 'jsfileschanged='$(git diff --name-only origin/$GITHUB_BASE_REF -- | grep '^js/*' | wc -l) >> $GITHUB_OUTPUT
echo 'Num js files changed='$(git diff --name-only origin/$GITHUB_BASE_REF -- | grep '^js/*' | wc -l)
- name: "Build Project (PR version)"
run: |
npm run build
if: steps.checkout.outputs.jsfileschanged > 0
- name: "Save built js-files"
uses: actions/upload-artifact@v7
with:
name: pr-build
if-no-files-found: error
path: |
./py/visdom/static/js/main.js
./py/visdom/static/js/main.js.map
visual-regression-test-init:
name: "Initialize Visual Regression Test"
runs-on: ubuntu-latest
needs: install-and-build
steps:
- name: "Checkout Repository"
uses: actions/checkout@v7.0.0
- name: "Save current Head-Ref as PR-branch"
shell: bash
run: |
git checkout -B PR-HEAD
- uses: ./.github/actions/prepare
with:
usebasebranch: true
loadprbuild: false
- name: "Checkout Tests from Head-Ref"
shell: bash
run: |
git checkout PR-HEAD -- ./cypress
git checkout PR-HEAD -- ./example
git checkout PR-HEAD -- ./package.json
git checkout PR-HEAD -- ./cypress.config.js
- name: "Install PR npm dependencies"
shell: bash
run: ELECTRON_SKIP_BINARY_DOWNLOAD=1 npm install
- name: Cypress test:init
uses: cypress-io/github-action@v7
with:
install: false
browser: chrome
start: visdom -port 8098 -env_path /tmp
wait-on: 'http://localhost:8098'
env: CYPRESS_CHROME_ARGS="--disable-gpu --disable-dev-shm-usage --no-sandbox --disable-setuid-sandbox"
spec: cypress/integration/*.init.js
- uses: actions/upload-artifact@v7
with:
name: cypress-init-screenshots
path: cypress/screenshots_init
visual-regression-test:
name: "Visual Regression Test"
runs-on: ubuntu-latest
needs: visual-regression-test-init
steps:
- name: "Checkout Repository"
uses: actions/checkout@v7.0.0
- uses: ./.github/actions/prepare
- uses: actions/download-artifact@v8
with:
name: cypress-init-screenshots
path: cypress/screenshots_init
- name: Cypress test:visual
uses: cypress-io/github-action@v7
with:
install: false
browser: chrome
start: visdom -port 8098 -env_path /tmp
wait-on: 'http://localhost:8098'
env: CYPRESS_CHROME_ARGS="--disable-gpu --disable-dev-shm-usage --no-sandbox --disable-setuid-sandbox"
spec: cypress/integration/screenshots.js
- uses: actions/upload-artifact@v7
if: failure()
with:
name: cypress-screenshots-visual
path: cypress/screenshots
functional-test:
name: "Functional Test (Websocket)"
runs-on: ubuntu-latest
needs: install-and-build
strategy:
matrix:
python: ['3.12', '3.13']
steps:
- name: "Checkout Repository"
uses: actions/checkout@v7.0.0
- uses: ./.github/actions/prepare
with:
python-version: ${{ matrix.python }}
- name: Cypress test
uses: cypress-io/github-action@v7
with:
install: false
browser: chrome
start: visdom -port 8098 -env_path /tmp
wait-on: 'http://localhost:8098'
env: CYPRESS_CHROME_ARGS="--disable-gpu --disable-dev-shm-usage --no-sandbox --disable-setuid-sandbox"
config: excludeSpecPattern=**/screenshots.*
- uses: actions/upload-artifact@v7
if: failure()
with:
name: cypress-screenshots-functional-${{ matrix.python }}
path: cypress/screenshots
functional-test-polling:
name: 'Functional Test (Polling)'
runs-on: ubuntu-latest
needs: install-and-build
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v7.0.0
- uses: ./.github/actions/prepare
- name: Cypress test
uses: cypress-io/github-action@v7
with:
install: false
browser: chrome
start: visdom -port 8098 -env_path /tmp -use_frontend_client_polling
wait-on: 'http://localhost:8098'
env: CYPRESS_CHROME_ARGS="--disable-gpu --disable-dev-shm-usage --no-sandbox --disable-setuid-sandbox"
config: excludeSpecPattern=**/screenshots.*
- uses: actions/upload-artifact@v7
if: failure()
with:
name: cypress-screenshots-functional-polling
path: cypress/screenshots
playwright-test:
name: "Playwright Functional Test"
runs-on: ubuntu-latest
needs: install-and-build
steps:
- name: "Checkout Repository"
uses: actions/checkout@v7.0.0
- uses: ./.github/actions/prepare
- name: Install Playwright Chromium
run: npx playwright install --with-deps chromium
- name: Run Playwright tests
run: npm run test:pw
- name: Upload Playwright Report
uses: actions/upload-artifact@v7
if: failure()
with:
name: playwright-report
path: playwright/playwright-report/