-
Notifications
You must be signed in to change notification settings - Fork 132
79 lines (77 loc) · 2.38 KB
/
e2e.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
name: Run e2e tests
on:
workflow_dispatch:
inputs:
run-target:
description: Command line for running e2e tests
default: 'yarn e2e -g packets.spec.ts --trace on'
required: true
platforms:
description: OS platforms to test on (list of strings in JSON format)"
default: '["ubuntu-20.04"]'
required: true
video:
description: Whether to record videos of Playwright test runs
type: choice
default: 'true'
options:
- 'true'
- 'false'
required: true
debug:
description: Playwright debug logging
type: choice
options:
- 'pw:api'
- ''
always-upload:
description: Always upload artifacts even if tests don't fail?
type: boolean
default: true
required: false
jobs:
run-e2e-tests:
name: Run e2e tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ${{ fromJSON(inputs.platforms) }}
steps:
- name: Output inputs
run: echo "${{ toJSON(inputs) }}"
shell: sh
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-zui
- name: Install dependencies (Linux)
if: startsWith(matrix.os, 'ubuntu-')
run: sudo apt-get -y install whois
- name: Install dependencies (Windows)
if: startsWith(matrix.os, 'windows-')
run: choco install -y --no-progress whois
- run: yarn lint
- run: yarn test
- run: yarn build
- name: End to end tests
id: playwright
run: |
if [ "$RUNNER_OS" = "Linux" ]; then
/usr/bin/xvfb-run --auto-servernum -s "-screen 0 1280x1024x24" ${{ inputs.run-target }}
else
${{ inputs.run-target }}
fi
env:
VIDEO: ${{ inputs.video }}
DEBUG: ${{ inputs.debug }}
shell: sh
- name: Put system logs alongside other artifacts
run: |
mkdir -p packages/zui-player/run/var_log
cp /var/log/sys*log* /var/log/kern.log* packages/zui-player/run/var_log || true
shell: sh
- uses: actions/upload-artifact@v2
if: (failure() && steps.playwright.outcome == 'failure') || inputs.always-upload
with:
name: artifacts-${{ matrix.os }}
path: |
packages/zui-player/run/**
packages/zui-player/test-results