-
-
Notifications
You must be signed in to change notification settings - Fork 79
73 lines (59 loc) · 1.74 KB
/
tests.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
name: Tests
on:
push:
branches:
- main
paths:
- 'src/**'
- 'tests/**'
- 'pnpm-lock.yaml'
- '.github/workflows/tests.yml'
pull_request:
paths:
- 'src/**'
- 'tests/**'
- 'pnpm-lock.yaml'
- '.github/workflows/tests.yml'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
browser: [webkit, firefox, chromium]
steps:
- uses: actions/[email protected]
- uses: pnpm/[email protected]
with:
version: 9
run_install: false
- uses: actions/[email protected]
with:
node-version: 22
cache: 'pnpm'
- uses: actions/[email protected]
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-${{ matrix.browser }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install deps
run: pnpm install --frozen-lockfile
- name: Type Check
run: pnpm ts
- name: Run unit tests
run: pnpm vitest run --coverage
- run: pnpm exec playwright install --with-deps ${{ matrix.browser }}
if: steps.playwright-cache.outputs.cache-hit != 'true'
- run: pnpm exec playwright install-deps ${{ matrix.browser }}
if: steps.playwright-cache.outputs.cache-hit == 'true'
- name: Build
run: pnpm vite build
- name: Run e2e tests
run: pnpm playwright test --project="${{ matrix.browser }}"
- name: Coverage
uses: davelosert/[email protected]
if: ${{ matrix.browser == 'webkit' && success() }}