Skip to content

Commit c167799

Browse files
committed
feat: add initial test setup and configuration in ExampleTest.php and tests.yml
1 parent a2aca94 commit c167799

File tree

3 files changed

+59
-0
lines changed

3 files changed

+59
-0
lines changed

.github/workflows/tests.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: "Run Tests - Current"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '[0-9]+x'
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
php: [8.4, 8.3, 8.2]
15+
laravel: ["^12.0", "^11.0"]
16+
dependency-version: [prefer-lowest, prefer-stable]
17+
include:
18+
- laravel: "^12.0"
19+
testbench: 10.*
20+
- laravel: "^11.0"
21+
testbench: 9.*
22+
23+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
29+
- name: Setup PHP
30+
uses: shivammathur/setup-php@v2
31+
with:
32+
php-version: ${{ matrix.php }}
33+
extensions: curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv
34+
coverage: pcov
35+
36+
- name: Install dependencies (remove passport)
37+
run: composer remove --dev laravel/passport --no-interaction --no-update
38+
if: matrix.laravel == '^8.12'
39+
40+
- name: Install dependencies
41+
run: |
42+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "symfony/console:>=4.3.4" "mockery/mockery:^1.3.2" "nesbot/carbon:>=2.72.6" --no-interaction --no-update
43+
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
44+
45+
- name: Execute tests
46+
run: vendor/bin/pest --parallel --coverage --min=80 --compact
47+
48+
- name: Execute php
49+
run: vendor/bin/pint --test

tests/Feature/ExampleTest.php

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
test('example', function () {
4+
expect(true)->toBeTrue();
5+
});

tests/Unit/ExampleTest.php

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
test('example', function () {
4+
expect(true)->toBeTrue();
5+
});

0 commit comments

Comments
 (0)