-
Notifications
You must be signed in to change notification settings - Fork 508
67 lines (65 loc) · 2.04 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
name: "playwright"
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- main
env:
LOG_LEVEL: ERROR
STATIC_DIR:
DATABASE_HOSTNAME: localhost
DATABASE_CREDENTIALS: dispatch:dispatch
DISPATCH_ENCRYPTION_KEY: NJHDWDJ3PbHT8h
DISPATCH_JWT_SECRET: foo
jobs:
end-to-end:
runs-on: ubuntu-20.04
services:
postgres:
image: postgres
env:
POSTGRES_USER: dispatch
POSTGRES_PASSWORD: dispatch
POSTGRES_DB: dispatch
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- uses: actions/setup-node@v4
with:
node-version: 16
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install python dependencies
run: |
export DISPATCH_LIGHT_BUILD=1
python -m pip install --upgrade pip
pip install psycopg[binary]
pip install -e ".[dev]"
- name: Install npm dependencies
run: |
npm ci -D --prefix src/dispatch/static/dispatch
npm install -D @playwright/test
- name: Install playwright browsers
run: npx playwright install --with-deps chromium
- name: Setup sample database
run: dispatch database restore --dump-file data/dispatch-sample-data.dump && dispatch database upgrade
- name: Run tests
run: npx playwright test --project=chromium
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30