Skip to content

Commit f719c9f

Browse files
committed
Fix tests running
1 parent 34f7b98 commit f719c9f

File tree

8 files changed

+53
-40
lines changed

8 files changed

+53
-40
lines changed

.github/workflows/phpstan.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ name: PHPStan
22

33
on:
44
push:
5-
paths:
6-
- '**.php'
7-
- 'phpstan.neon.dist'
5+
branches:
6+
- master
87
pull_request:
98
types: [opened, synchronize, reopened]
109

@@ -18,7 +17,7 @@ jobs:
1817
- name: Setup PHP
1918
uses: shivammathur/setup-php@v2
2019
with:
21-
php-version: '8.1'
20+
php-version: '8.4'
2221
coverage: none
2322

2423
- name: Install composer dependencies

.github/workflows/run-tests.yml

+18-7
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,17 @@ on:
55
branches:
66
- master
77
pull_request:
8-
types:
9-
- opened
10-
- synchronize
11-
- reopened
8+
types: [opened, synchronize, reopened]
129

1310
jobs:
1411
test:
1512
runs-on: ${{ matrix.os }}
1613

1714
strategy:
18-
fail-fast: true
15+
fail-fast: false
1916
matrix:
2017
os: [ubuntu-latest, windows-latest]
21-
php: ['8.1', '8.2', '8.3']
18+
php: ['8.1', '8.2', '8.3', '8.4']
2219
laravel: ['9.*', '10.*', '11.*', '12.*']
2320
stability: [prefer-lowest, prefer-stable]
2421
exclude:
@@ -30,6 +27,9 @@ jobs:
3027
php: '8.1'
3128

3229
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
30+
defaults:
31+
run:
32+
shell: bash
3333

3434
steps:
3535
- name: Checkout code
@@ -39,7 +39,7 @@ jobs:
3939
uses: shivammathur/setup-php@v2
4040
with:
4141
php-version: ${{ matrix.php }}
42-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
42+
extensions: curl
4343
coverage: pcov
4444
ini-values: pcov.directory=., pcov.exclude="~vendor~"
4545

@@ -48,6 +48,17 @@ jobs:
4848
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
4949
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
5050
51+
- name: Get Composer Cache Directory
52+
id: composer-cache
53+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
54+
- name: Cache composer files
55+
uses: actions/cache@v4
56+
with:
57+
path: ${{ steps.composer-cache.outputs.dir }}
58+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ matrix.php }}-${{ matrix.laravel }}-${{ matrix.stability }}
59+
restore-keys: |
60+
${{ runner.os }}-composer-
61+
5162
- name: Install dependencies
5263
run: |
5364
composer require "illuminate/contracts:${{ matrix.laravel }}" --no-interaction --no-update

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.idea
22
.phpunit.result.cache
3+
.phpunit.cache
34
build
45
composer.lock
56
coverage

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
},
2929
"require-dev": {
3030
"guzzlehttp/guzzle": "^7.8",
31-
"larastan/larastan": "^2.0.1",
31+
"larastan/larastan": "^2.0|^3.0",
3232
"laravel/pint": "^0.2.2|^1.21",
3333
"nunomaduro/collision": "^6.0|^7.0|^8.0",
3434
"orchestra/testbench": "^7.0|^8.0|^9.0|^10.0",

phpstan.neon.dist

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@ includes:
22
- phpstan-baseline.neon
33

44
parameters:
5-
level: 4
65
paths:
76
- src
8-
- config
7+
inferPrivatePropertyTypeFromConstructor: true
8+
level: 4
99
tmpDir: build/phpstan
1010
checkOctaneCompatibility: true
1111
checkModelProperties: true
12-
checkMissingIterableValueType: false
13-

phpunit.xml.dist

+22-24
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,35 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
55
backupGlobals="false"
6-
backupStaticAttributes="false"
76
bootstrap="vendor/autoload.php"
87
colors="true"
9-
convertErrorsToExceptions="true"
10-
convertNoticesToExceptions="true"
11-
convertWarningsToExceptions="true"
128
processIsolation="false"
139
stopOnFailure="false"
1410
executionOrder="random"
1511
failOnWarning="true"
1612
failOnRisky="true"
1713
failOnEmptyTestSuite="true"
1814
beStrictAboutOutputDuringTests="true"
19-
verbose="true"
20-
>
21-
<testsuites>
22-
<testsuite name="Pirsch Test Suite">
23-
<directory>tests</directory>
24-
</testsuite>
25-
</testsuites>
26-
<coverage>
27-
<include>
28-
<directory suffix=".php">./src</directory>
29-
</include>
30-
<report>
31-
<html outputDirectory="build/coverage"/>
32-
<text outputFile="build/coverage.txt"/>
33-
<clover outputFile="build/logs/clover.xml"/>
34-
</report>
35-
</coverage>
36-
<logging>
37-
<junit outputFile="build/report.junit.xml"/>
38-
</logging>
15+
cacheDirectory=".phpunit.cache"
16+
backupStaticProperties="false">
17+
<testsuites>
18+
<testsuite name="Pirsch Test Suite">
19+
<directory>tests</directory>
20+
</testsuite>
21+
</testsuites>
22+
<coverage>
23+
<report>
24+
<html outputDirectory="build/coverage"/>
25+
<text outputFile="build/coverage.txt"/>
26+
<clover outputFile="build/logs/clover.xml"/>
27+
</report>
28+
</coverage>
29+
<logging>
30+
<junit outputFile="build/report.junit.xml"/>
31+
</logging>
32+
<source>
33+
<include>
34+
<directory suffix=".php">./src</directory>
35+
</include>
36+
</source>
3937
</phpunit>

src/Facades/Pirsch.php

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
use Illuminate\Support\Facades\Facade;
66

7+
/**
8+
* @method static void track(?string $name = null, ?array $meta = null)
9+
*
10+
* @see \Pirsch\Pirsch
11+
*/
712
class Pirsch extends Facade
813
{
914
protected static function getFacadeAccessor()

src/Pirsch.php

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public static function track(
4747
],
4848
);
4949
} catch (ConnectionException) {
50+
// remove error
5051
}
5152
});
5253
}

0 commit comments

Comments
 (0)