-
Notifications
You must be signed in to change notification settings - Fork 14
76 lines (63 loc) · 2.3 KB
/
Copy pathphpunit.yml
File metadata and controls
76 lines (63 loc) · 2.3 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
name: Run PHPUnit Tests
permissions:
contents: read
on:
workflow_dispatch: # Manual only — does not run automatically
jobs:
phpunit:
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb:10.11
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: invoiceplane_test
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping --silent"
--health-interval=10s
--health-timeout=5s
--health-retries=5
env:
DB_CONNECTION: mariadb
DB_HOST: 127.0.0.1
DB_PORT: 3306
DB_DATABASE: invoiceplane_test
DB_USERNAME: root
DB_PASSWORD: root
steps:
- uses: actions/checkout@v4
- name: Setup PHP with Composer
uses: ./.github/actions/setup-php-composer
with:
php-version: '8.4'
php-extensions: 'mbstring, bcmath, pdo_mysql'
composer-flags: '--no-progress --prefer-dist --optimize-autoloader'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'yarn'
- name: Install JS dependencies
run: yarn install --frozen-lockfile
- name: Build frontend assets
# Feature tests render real Blade views with @vite(...) directives
# (e.g. GuestQuoteViewTest exercises resources/css/guest.css) — without
# a built manifest those fail with "Unable to locate file in Vite
# manifest", not a PHP bug. quickstart.yml already builds assets before
# its own artisan test run for the same reason; mirror that here.
run: yarn build
- name: Prepare Laravel environment
run: |
cp .env.testing.example .env.testing
php artisan key:generate --env=testing
- name: Run Laravel migrations
run: php artisan migrate --force --env=testing
- name: Run PHPUnit
# No --exclude-group flag here on purpose: passing it explicitly on the
# CLI was found to override (not add to) phpunit.xml's own <groups>
# <exclude> config, causing failing/flaky/troubleshooting-tagged tests
# to run anyway — confirmed by testing both ways. phpunit.xml's own
# config already excludes them; rely on that instead.
run: php artisan test --env=testing