Skip to content

Commit aa9319d

Browse files
committed
feat: separated test suits
1 parent c743458 commit aa9319d

File tree

3 files changed

+89
-3
lines changed

3 files changed

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

.github/workflows/run-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ jobs:
6565
- name: Execute tests on Linux
6666
if: "matrix.os == 'ubuntu-latest'"
6767
run: |
68-
xvfb-run -a vendor/bin/pest
68+
xvfb-run -a vendor/bin/pest --exclude-group=feature
6969
env:
7070
DISPLAY: ":99"
7171

7272
- name: Execute tests on Windows or Mac
7373
if: "matrix.os == 'windows-latest' || matrix.os == 'macos-latest'"
74-
run: vendor/bin/pest
74+
run: vendor/bin/pest --exclude-group=feature

tests/Pest.php

Lines changed: 7 additions & 1 deletion
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)