Skip to content

Commit eac69c2

Browse files
authored
Support Laravel 12.x & PHP 8.4 (#166)
1 parent 46e6901 commit eac69c2

File tree

4 files changed

+118
-37
lines changed

4 files changed

+118
-37
lines changed
+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Run only Features tests
2+
# TODO: Currently failing on ubuntu-latest and prefer-lowest
3+
# TODO: Find a way to output electron logs to the console
4+
name: run-feature-tests
5+
6+
on:
7+
workflow_dispatch:
8+
push:
9+
branches:
10+
- main
11+
pull_request:
12+
branches:
13+
- main
14+
15+
jobs:
16+
test:
17+
runs-on: ${{ matrix.os }}
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
os: [
23+
windows-latest,
24+
macos-latest
25+
# ubuntu-latest,
26+
]
27+
php: [ 8.4, 8.3, 8.2, 8.1 ]
28+
laravel: [ '10.*', '11.*', '12.*' ]
29+
stability: [
30+
# prefer-lowest,
31+
prefer-stable
32+
]
33+
exclude:
34+
- laravel: 10.*
35+
php: 8.4
36+
- laravel: 11.*
37+
php: 8.1
38+
- laravel: 12.*
39+
php: 8.1
40+
41+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
42+
43+
steps:
44+
- name: Checkout code
45+
uses: actions/checkout@v4
46+
47+
- name: Use Node.js
48+
uses: actions/setup-node@v4
49+
with:
50+
node-version: 20.x
51+
52+
- name: Setup PHP
53+
uses: shivammathur/setup-php@v2
54+
with:
55+
php-version: ${{ matrix.php }}
56+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
57+
coverage: none
58+
59+
- name: Setup problem matchers
60+
run: |
61+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
62+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
63+
64+
- name: Install dependencies
65+
run: |
66+
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
67+
composer update --${{ matrix.stability }} --no-interaction
68+
69+
- name: List Installed Dependencies
70+
run: composer show
71+
72+
- name: Show pest version
73+
run: vendor/bin/pest --version
74+
75+
- name: Execute tests on Linux
76+
if: "matrix.os == 'ubuntu-latest'"
77+
run: |
78+
xvfb-run -a vendor/bin/pest --group=feature
79+
env:
80+
DISPLAY: ":99"
81+
82+
- name: Execute tests on Windows or Mac
83+
if: "matrix.os == 'windows-latest' || matrix.os == 'macos-latest'"
84+
run: vendor/bin/pest --group=feature

.github/workflows/run-tests.yml

+17-26
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,30 @@ name: run-tests
33
on:
44
workflow_dispatch:
55
push:
6-
branches: [main]
6+
branches:
7+
- main
78
pull_request:
8-
branches: [main]
9+
branches:
10+
- main
911

1012
jobs:
1113
test:
1214
runs-on: ${{ matrix.os }}
15+
1316
strategy:
1417
fail-fast: false
1518
matrix:
16-
os: [ubuntu-latest, windows-latest]
17-
php: [8.2, 8.1, 8.3]
18-
laravel: [10.*, 11.*]
19-
stability: [prefer-lowest, prefer-stable]
20-
include:
21-
- laravel: 10.*
22-
testbench: ^8.18
23-
carbon: ^2.67
24-
laravel-package-tools: ^1.16.4
25-
collision: 7.*
26-
- laravel: 11.*
27-
testbench: 9.*
28-
carbon: "^2.67|^3.0"
29-
laravel-package-tools: ^1.16.4
30-
collision: ^8.1.1
19+
os: [ ubuntu-latest, windows-latest, macos-latest ]
20+
php: [ 8.4, 8.3, 8.2, 8.1 ]
21+
laravel: [ '10.*', '11.*', '12.*' ]
22+
stability: [ prefer-lowest, prefer-stable ]
3123
exclude:
24+
- laravel: 10.*
25+
php: 8.4
3226
- laravel: 11.*
3327
php: 8.1
28+
- laravel: 12.*
29+
php: 8.1
3430

3531
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
3632

@@ -57,19 +53,14 @@ jobs:
5753
5854
- name: Install dependencies
5955
run: |
60-
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.carbon }}" "spatie/laravel-package-tools:${{ matrix.laravel-package-tools }}" "nunomaduro/collision:${{ matrix.collision }}" --no-interaction --no-update
56+
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
6157
composer update --${{ matrix.stability }} --no-interaction
6258
6359
- name: List Installed Dependencies
64-
run: composer show -D
60+
run: composer show
6561

6662
- name: Show pest version
6763
run: vendor/bin/pest --version
6864

69-
- name: Execute tests on Linux
70-
if: matrix.os == 'ubuntu-latest'
71-
run: Xvfb :99 & DISPLAY=:99 vendor/bin/pest
72-
73-
- name: Execute tests on Windows
74-
if: matrix.os == 'windows-latest'
75-
run: vendor/bin/pest
65+
- name: Execute tests
66+
run: vendor/bin/pest --exclude-group=feature

composer.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,24 @@
3232
],
3333
"require": {
3434
"php": "^8.1",
35-
"illuminate/contracts": "^10.0|^11.0",
35+
"illuminate/contracts": "^10.0|^11.0|^12.0",
3636
"laravel/prompts": "^0.1.1|^0.2|^0.3",
37-
"nativephp/laravel": "*",
37+
"nativephp/laravel": "dev-main",
3838
"nativephp/php-bin": "^0.5.1",
3939
"spatie/laravel-package-tools": "^1.16.4",
4040
"symfony/filesystem": "^6.4|^7.2"
4141
},
4242
"require-dev": {
4343
"laravel/pint": "^1.0",
44-
"nunomaduro/collision": "^7.9",
45-
"nunomaduro/larastan": "^2.0.1",
46-
"orchestra/testbench": "^8.18",
47-
"pestphp/pest": "^2.7",
48-
"pestphp/pest-plugin-arch": "^2.0",
49-
"pestphp/pest-plugin-laravel": "^2.0",
44+
"nunomaduro/collision": "^7.9|^8.1.1",
45+
"larastan/larastan": "^2.0.1|^3.0",
46+
"orchestra/testbench": "^8.18|^9.0|^10.0",
47+
"pestphp/pest": "^2.7|^3.7",
48+
"pestphp/pest-plugin-arch": "^2.0|^3.0",
49+
"pestphp/pest-plugin-laravel": "^2.0|^3.1",
5050
"phpstan/extension-installer": "^1.1",
51-
"phpstan/phpstan-deprecation-rules": "^1.0",
52-
"phpstan/phpstan-phpunit": "^1.0",
51+
"phpstan/phpstan-deprecation-rules": "^1.0|^2.0",
52+
"phpstan/phpstan-phpunit": "^1.0|^2.0",
5353
"spatie/laravel-ray": "^1.26"
5454
},
5555
"autoload": {

tests/Pest.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
use Native\Electron\Tests\TestCase;
44
use Symfony\Component\Filesystem\Filesystem;
55

6-
uses(TestCase::class)->in('Feature', 'Unit');
6+
uses(TestCase::class)
7+
->group('feature')
8+
->in('Feature');
9+
10+
uses(TestCase::class)
11+
->group('unit')
12+
->in('Unit');
713

814
function testsDir(string $path = ''): string
915
{

0 commit comments

Comments
 (0)