-
Notifications
You must be signed in to change notification settings - Fork 1
141 lines (120 loc) · 5.01 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Tests
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]
jobs:
test:
env:
DATABASE_URL: postgresql://prisma:prisma@localhost:5434/mpa
AWS_S3_UPLOAD_BUCKET: test
JWT_SECRET_KEY: test
PUBLIC_GOOGLE_OAUTH_CLIENT_ID: test
GOOGLE_OAUTH_CLIENT_SECRET: test
PUBLIC_UPLOAD_BASE_URL: https://mpath.freetls.fastly.net/upload/
LOG_TRANSPORT: lambda
LOG_LEVEL: info
LOG_DB_QUERIES: false
ORIGIN: http://127.0.0.1:4173
FASTLY_SERVICE_ID: test
FASTLY_API_KEY: test
PUBLIC_DB_RESTORE: test
AWS_XRAY_CONTEXT_MISSING: IGNORE_ERROR
timeout-minutes: 60
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install apt-fast
run: /bin/bash -c "$(curl -sL https://git.io/vokNn)"
- name: Playwright dependencies (apt-fast)
run: /usr/local/sbin/apt-fast update -y && /usr/local/sbin/apt-fast install -y --no-install-recommends xvfb fonts-noto-color-emoji fonts-unifont libfontconfig1 libfreetype6 xfonts-cyrillic xfonts-scalable fonts-liberation fonts-ipafont-gothic fonts-wqy-zenhei fonts-tlwg-loma-otf fonts-freefont-ttf libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libcairo2 libcups2 libdbus-1-3 libdrm2 libgbm1 libglib2.0-0 libnspr4 libnss3 libpango-1.0-0 libwayland-client0 libx11-6 libxcb1 libxcomposite1 libxdamage1 libxext6 libxfixes3 libxkbcommon0 libxrandr2 ffmpeg libcairo-gobject2 libdbus-glib-1-2 libgdk-pixbuf-2.0-0 libgtk-3-0 libpangocairo-1.0-0 libx11-xcb1 libxcb-shm0 libxcursor1 libxi6 libxrender1 libxtst6 libenchant-2-2 gstreamer1.0-libav gstreamer1.0-plugins-bad gstreamer1.0-plugins-base gstreamer1.0-plugins-good libicu70 libegl1 libepoxy0 libevdev2 libffi7 libgles2 libglx0 libgstreamer-gl1.0-0 libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 libgudev-1.0-0 libharfbuzz-icu0 libharfbuzz0b libhyphen0 libjpeg-turbo8 liblcms2-2 libmanette-0.2-0 libnotify4 libopengl0 libopenjp2-7 libopus0 libpng16-16 libproxy1v5 libsecret-1-0 libsoup2.4-1 libwayland-egl1 libwayland-server0 libwebpdemux2 libwoff1 libxml2 libxslt1.1 libx264-163 libatomic1 libevent-2.1-7
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Get installed Playwright version
id: playwright-version
run: echo "PLAYWRIGHT_VERSION=$(pnpm -F @mpa/web ls @playwright/test | grep '@playwright/test' | awk '{print $2}')" >> $GITHUB_ENV
- name: Cache playwright binaries
uses: actions/cache@v3
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
- name: Install playwright
run: pnpm dlx [email protected] install --with-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
- name: Install playwright dependencies
run: pnpm dlx [email protected] install-deps
if: steps.playwright-cache.outputs.cache-hit == 'true'
- name: Build and set up db
run: pnpm web prepare:e2e
- name: Run Playwright tests
run: pnpm web test:e2e
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: packages/web/playwright-report/
retention-days: 30
check:
timeout-minutes: 60
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Build project
run: pnpm -F "@mpa/web"^... -F !'@mpa/migration-runner' build
- name: Sveltekit generated files
run: pnpm web exec svelte-kit sync
- name: Run Svelte check
run: pnpm web check > packages/web/svelte-check.txt
- uses: actions/upload-artifact@v3
if: always()
with:
name: svelte-check
path: packages/web/svelte-check.txt
retention-days: 30