Repository navigation
151 lines (133 loc) · 5.46 KB
/
Copy pathe2e-tests.yml
File metadata and controls
151 lines (133 loc) · 5.46 KB
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
142
143
144
145
146
147
148
149
150
151
name: E2E Tests
on:
push:
branches: [develop]
pull_request:
branches: [develop]
permissions:
contents: read
jobs:
e2e:
timeout-minutes: 60
runs-on: ubuntu-latest
services:
db:
image: mariadb:10.11
env:
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: "yes"
MARIADB_DATABASE: invoiceplane_test
options: >-
--health-cmd="healthcheck.sh --connect --innodb_initialized"
--health-interval=10s
--health-timeout=5s
--health-retries=3
ports:
- 3306:3306
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: mbstring,pdo,pdo_mysql
tools: composer
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'yarn'
- name: Cache Composer packages
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install PHP dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Install npm dependencies
run: yarn install --frozen-lockfile
- name: Build frontend assets
# Every page Playwright navigates to goes through a real running
# `php artisan serve` and a real browser — including Filament's own
# per-panel Vite themes (resources/css/filament/**, see CLAUDE.md)
# and any view using @vite(...) directly (e.g. the guest quote
# views' resources/css/guest.css). Without a built manifest this
# isn't a narrow failure, it 500s essentially every page in the
# whole E2E suite, not just Vite-specific tests.
run: yarn build
- name: Setup environment
run: |
cp .env.example .env
php artisan key:generate
- name: Publish Filament frontend assets
# `composer install` above runs with --no-scripts, so the
# post-autoload-dump hook that normally runs `filament:upgrade`
# (which runs `filament:assets`) is skipped and public/js/filament/**
# is never written. yarn build only produces the per-panel CSS
# themes — Filament ships its own precompiled JS (Alpine plugins that
# drive every modal, combobox, and repeater) separately, via this
# command. Without it the app still renders and navigates, so list
# pages and the navigation smoke tests pass, but nothing interactive
# works: clicking "New X" never opens a modal, `<button
# role="combobox">` selects can't be driven, repeater "Add row" and
# "Add Team Member" do nothing. Run 34348125213: ~40 specs failed
# exactly this way while every read-only/server-rendered spec passed.
run: php artisan filament:assets
- name: Run migrations and seeders
run: php artisan migrate --seed
env:
DB_HOST: 127.0.0.1
DB_PORT: 3306
DB_DATABASE: invoiceplane_test
DB_USERNAME: root
DB_PASSWORD: ''
- name: Start application server
# --no-reload is mandatory here, not cosmetic: without it `artisan serve`
# prints "Unable to respect the PHP_CLI_SERVER_WORKERS environment
# variable without the --no-reload flag. Only creating a single server."
# and runs the PHP built-in server single-threaded. A single-threaded
# server deadlocks every Filament modal in the suite — clicking "New X"
# fires a Livewire mountAction round-trip while the list page still has
# connections in flight, the second request queues behind the first, and
# the modal never opens (30s Playwright timeout). Dedicated /create pages
# (one request) pass, modals (relations, contacts, admin/*, note/expense
# categories, "Add Team Member", repeater "Add row") all time out. With
# --no-reload the server honours PHP_CLI_SERVER_WORKERS=4 from .env and
# forks real workers, matching how php-fpm serves the app in every other
# environment.
run: |
php artisan serve --host=127.0.0.1 --port=8000 --no-reload &
sleep 5
env:
DB_HOST: 127.0.0.1
DB_PORT: 3306
DB_DATABASE: invoiceplane_test
DB_USERNAME: root
DB_PASSWORD: ''
- name: Install Playwright browsers
run: npx playwright install chromium
- name: Run E2E tests
run: npm run e2e
env:
APP_URL: http://127.0.0.1:8000
# Defaults match the account DatabaseSeeder always creates and
# attaches to the `ivplv2` company; override via secrets if a
# dedicated E2E account is introduced later.
E2E_EMAIL: ${{ secrets.E2E_EMAIL || 'admin@invoiceplane.com' }}
E2E_PASSWORD: ${{ secrets.E2E_PASSWORD || 'password' }}
E2E_TENANT: ${{ secrets.E2E_TENANT || 'ivplv2' }}
DB_HOST: 127.0.0.1
DB_PORT: 3306
DB_DATABASE: invoiceplane_test
DB_USERNAME: root
DB_PASSWORD: ''
- name: Upload Playwright Report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30