-
Notifications
You must be signed in to change notification settings - Fork 3
83 lines (68 loc) · 2.21 KB
/
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
name: Test UI
on:
workflow_dispatch:
pull_request:
branches:
- 'develop'
- 'main'
env:
JAPREADER_ENV: playwright
NODE_ENV: development
CLEAR_TOKENS: true
JAPREADER_LOGS: silly
PLAYWRIGHT: true
DEBUG: pw:browser*,pw:api
DEBUG_FILE: playwright.log
jobs:
test-ubuntu:
name: Run Playwright e2e tests on ubuntu-latest
runs-on: ubuntu-latest
steps:
# Make sure build is clean and no files from a previous run are re-used.
- name: Cleanup files before run
run: |
rm -rf *
if: ${{ always() }}
- name: Checkout
uses: actions/[email protected]
- name: Use Node.js 20
uses: actions/[email protected]
with:
node-version: 20.x
cache: 'yarn'
- name: Install node packages
run: yarn install
- name: Install Test dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y dpkg fakeroot rpm libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libgtk-3-0 libpango-1.0-0 libcairo2 libgdk-pixbuf2.0-0 libgbm1 libasound2 libatspi2.0-0 fonts-takao-mincho
- name: Install playwright
run: npx playwright install
- name: Provide 777 execution rights to clipboard handler script
run: |
sudo chmod 777 node_modules/clipboard-event/platform/clipboard-event-handler-linux
- name: Package
run: yarn package
- name: Run headless test
uses: coactions/setup-xvfb@v1
with:
options: -screen 0 800x600x24
run: yarn test:ui
- name: Tree list the runner
if: always()
run: tree . -I 'node_modules|src|images'
- name: Read test log file
if: always()
run: |
[ -f playwright.log ] && cat playwright.log || true
- name: Copy the log file into the artifact folder
if: always()
run: |
[ -f playwright.log ] && mv playwright.log test-results/ || true
- name: Upload a Test Artifact
if: always()
uses: actions/[email protected]
with:
name: japReader-test-ui@${{ github.sha }}
path: test-results
retention-days: 28