-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (40 loc) · 1.15 KB
/
run-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
name: Run tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
run-tests:
strategy:
matrix:
test: [unit, e2e]
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup pnpm
uses: pnpm/action-setup@v2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: pnpm
- name: Install Repository dependencies
run: pnpm install
- name: Cache Playwright dependencies
if: matrix.test == 'e2e'
uses: actions/cache@v3
with:
path: ~/.cache/ms-playwright/
key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-playwright-
- name: Install Playwright dependencies
if: matrix.test == 'e2e'
run: pnpm exec playwright install --with-deps chromium
- name: 🏄 Copy test env vars
if: matrix.test == 'e2e'
run: cp .env.example .env
- name: Run ${{ matrix.test }} tests
run: pnpm run test:${{ matrix.test }}