forked from oxen-io/session-playwright
-
Notifications
You must be signed in to change notification settings - Fork 2
166 lines (139 loc) · 5.16 KB
/
desktop-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
name: Run desktop regression tests
on:
workflow_dispatch:
inputs:
PLAYWRIGHT_REPO:
description: 'Playwright repo to checkout'
required: true
type: choice
options:
- session-foundation/session-playwright
- burtonemily/session-playwright
- bilb/session-playwright
default: session-foundation/session-playwright
BRANCH_TO_CHECKOUT_PW:
description: 'branch to checkout on session-playwright'
required: true
type: string
default: ci-desktop-regression-self-hosted
SESSION_DESKTOP_REPO:
description: 'Session desktop repo to checkout'
required: true
type: choice
options:
- session-foundation/session-desktop
- bilb/session-desktop
default: session-foundation/session-desktop
BRANCH_TO_CHECKOUT_SESSION:
description: 'Branch to checkout on session-desktop'
required: true
type: string
default: unstable
PLAYWRIGHT_REPEAT_COUNT:
description: 'Repeats of each tests (0 to only run each once)'
required: true
type: number
default: 0
PLAYWRIGHT_RETRIES_COUNT:
description: 'Retries of each tests (0 to only run each once, 1 to run another attempt)'
required: true
type: number
default: 0
PLAYWRIGHT_WORKER_COUNT:
description: 'Playwright workers to start'
required: true
type: number
default: 4
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
desktop-regression:
name: Desktop Regression Tests
runs-on: [self-hosted, Linux, X64, qa-desktop]
container:
image: mcr.microsoft.com/playwright:v1.47.1-noble
options: --cpus 8
env:
# PLAYWRIGHT_CUSTOM_REPORTER: 1
PLAYWRIGHT_REPEAT_COUNT: ${{ github.event.inputs.PLAYWRIGHT_REPEAT_COUNT }}
PLAYWRIGHT_RETRIES_COUNT: ${{ github.event.inputs.PLAYWRIGHT_RETRIES_COUNT }}
PLAYWRIGHT_WORKER_COUNT: ${{ github.event.inputs.PLAYWRIGHT_WORKER_COUNT }}
DESKTOP_CACHED_FOLDER: desktop/node_modules
steps:
- uses: actions/checkout@v4
- name: Runner Details
run: |
echo "PLAYWRIGHT_REPO ${{ github.event.inputs.PLAYWRIGHT_REPO }}"
echo "BRANCH_TO_CHECKOUT_PW ${{ github.event.inputs.BRANCH_TO_CHECKOUT_PW }}"
echo "SESSION_DESKTOP_REPO ${{ github.event.inputs.SESSION_DESKTOP_REPO }}"
echo "BRANCH_TO_CHECKOUT_SESSION ${{ github.event.inputs.BRANCH_TO_CHECKOUT_SESSION }}"
- uses: actions/checkout@v4
name: 'Checkout playwright'
with:
repository: ${{ github.event.inputs.PLAYWRIGHT_REPO }}
ref: ${{ github.event.inputs.BRANCH_TO_CHECKOUT_PW }}
path: 'playwright'
- name: Install system deps
run: apt update && apt install -y git g++ build-essential cmake
- uses: actions/checkout@v4
name: 'Checkout Session desktop'
with:
repository: ${{ github.event.inputs.SESSION_DESKTOP_REPO }}
ref: ${{ github.event.inputs.BRANCH_TO_CHECKOUT_SESSION }}
path: 'desktop'
- name: Calculate desktop cache key
run: |
echo "CACHE_KEY=${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('desktop/package.json', 'desktop/yarn.lock', 'desktop/patches/**') }}" >> $GITHUB_ENV
- name: Install node
uses: actions/setup-node@v3
with:
node-version-file: 'desktop/.nvmrc'
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- uses: actions/cache/restore@v4
id: cache-desktop-modules
with:
path: ${{ env.DESKTOP_CACHED_FOLDER }}
key: ${{ env.CACHE_KEY }}
- name: Install yarn
run: |
npm install -g yarn
- name: List desktop folder
run: |
pwd
ls -la desktop
- name: List playwright folder
run: |
pwd
ls -la playwright
- name: Install desktop dependencies
shell: bash
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
run: cd $GITHUB_WORKSPACE/desktop && yarn install --frozen-lockfile --network-timeout 600000
- uses: actions/cache/save@v4
if: always()
with:
path: ${{ env.DESKTOP_CACHED_FOLDER }}
key: ${{ env.CACHE_KEY }}
- name: Build desktop
shell: bash
run: cd $GITHUB_WORKSPACE/desktop && yarn build-everything
- name: Install playwright dependencies
run: |
cd $GITHUB_WORKSPACE/playwright && yarn install --frozen-lockfile
- name: Build the Desktop tests
run: |
cd $GITHUB_WORKSPACE/playwright
yarn tsc
- name: Run the Desktop tests
run: |
cd $GITHUB_WORKSPACE/playwright
SESSION_DESKTOP_ROOT=$GITHUB_WORKSPACE/desktop DEBUG=pw:browser xvfb-run --auto-servernum --server-num=1 --server-args='-screen 0, 1920x1080x24' yarn test -g "Create User"
- name: Kill all running electron app
if: always()
continue-on-error: true # just so we don't fail
shell: bash
run: |
killall electron;