-
Notifications
You must be signed in to change notification settings - Fork 2
126 lines (107 loc) · 3.09 KB
/
playwright.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
---
name: E2E Visual Regression Testing
on:
push:
branches: [main]
paths:
- src/**
- tests/e2e/**
- playwright.config.ts
- pnpm-lock.yaml
- tsconfig.json
- tsconfig.*.json
pull_request:
branches: [main]
permissions:
actions: write
checks: write
contents: write
deployments: write
discussions: write
issues: write
packages: write
pages: write
pull-requests: write
repository-projects: write
security-events: read
statuses: write
jobs:
test:
name: Run Playwright Tests
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up TeX Live
uses: teatimeguest/setup-texlive-action@v3
with:
packages: |
scheme-basic
luatex
xetex
latexmk
dvisvgm
standalone
pgf
microtype
mathtools
luatex85
lipsum
xcolor
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: latest
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: pnpm
cache-dependency-path: ./pnpm-lock.yaml
- name: Install dependencies
run: pnpm install
- name: Install Poppler
run: sudo apt-get install -y poppler-data poppler-utils
- name: Install MuPDF
run: sudo apt-get install -y mupdf mupdf-tools
# Playwright caching. Adapted from
# https://github.com/microsoft/playwright/issues/7249#issuecomment-1385567519
- name: Store Playwright Version
run: |
PLAYWRIGHT_VERSION=$(pnpm ls @playwright/test | grep @playwright | sed 's|.*playwright/test ||')
echo "Playwright Version: $PLAYWRIGHT_VERSION"
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
- name: Cache Playwright Browsers for Playwright's Version
id: cache-playwright-browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }}
- name: Setup Playwright
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
run: pnpm exec playwright install --with-deps
- name: Build SvelTeX
run: pnpm build
- name: Install Dependencies for Test Project
run: pnpm install
working-directory: tests/e2e
- name: Build Test Project
run: pnpm build
working-directory: tests/e2e
- name: Run Playwright tests
run: pnpm playwright
- name: Upload Playwright Report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- name: Upload Actual Screenshots
uses: actions/upload-artifact@v4
if: always()
with:
name: actual-screenshots
path: tests/e2e/basic.spec.ts-snapshots/
retention-days: 7