-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (53 loc) · 2 KB
/
blaze-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
name: Playwright Tests for App Built with Starter Kit
on: [push, pull_request]
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
DEBUG: 0
ALLOWED_HOSTS: '*'
CSRF_TRUSTED_ORIGINS: ${{ vars.CSRF_TRUSTED_ORIGINS }}
EMAIL_BACKEND: ${{ secrets.EMAIL_BACKEND }}
EMAIL_HOST: ${{ secrets.EMAIL_HOST }}
EMAIL_PORT: ${{ secrets.EMAIL_PORT }}
EMAIL_HOST_USER: ${{ secrets.EMAIL_HOST_USER }}
EMAIL_HOST_PASSWORD: ${{ secrets.EMAIL_HOST_PASSWORD }}
EMAIL_USE_TLS: 1
PLAYWRIGHT_USERNAME: ${{ secrets.PLAYWRIGHT_USERNAME }}
PLAYWRIGHT_PASSWORD: ${{ secrets.PLAYWRIGHT_PASSWORD }}
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Django bits
run: |
mkdir test_project
cd test_project
python3 -m venv --prompt . .venv
.venv/bin/pip install -U pip setuptools wheel
.venv/bin/python -m pip install Django uv
.venv/bin/django-admin startproject --template=https://github.com/piepworks/django-starter/archive/${BRANCH_NAME}.zip test_project .
.venv/bin/uv sync --no-dev --locked
.venv/bin/python manage.py makemigrations
.venv/bin/python manage.py migrate --noinput
.venv/bin/python manage.py loaddata e2e/django-fixtures.json
.venv/bin/python manage.py collectstatic --noinput
npm install
npm run build
- name: Install dependencies
run: cd test_project && npm ci
- name: Install Playwright Browsers
run: cd test_project && npx playwright install --with-deps
- name: Run Playwright tests
run: cd test_project && CREATE_USER=True npx playwright test --ignore-snapshots
- uses: actions/upload-artifact@v4
if: always()
with:
name: artifacts
path: |
test_project/playwright-report/
test_project/test-results/
retention-days: 2