Skip to content

Fix tests running #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ name: PHPStan

on:
push:
paths:
- '**.php'
- 'phpstan.neon.dist'
branches:
- master
pull_request:
types: [opened, synchronize, reopened]

Expand All @@ -18,7 +17,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.4'
coverage: none

- name: Install composer dependencies
Expand Down
25 changes: 18 additions & 7 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,17 @@ on:
branches:
- master
pull_request:
types:
- opened
- synchronize
- reopened
types: [opened, synchronize, reopened]

jobs:
test:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: true
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
php: ['8.1', '8.2', '8.3']
php: ['8.1', '8.2', '8.3', '8.4']
laravel: ['9.*', '10.*', '11.*', '12.*']
stability: [prefer-lowest, prefer-stable]
exclude:
Expand All @@ -30,6 +27,9 @@ jobs:
php: '8.1'

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
defaults:
run:
shell: bash

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

Expand All @@ -48,6 +48,17 @@ jobs:
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer files
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ matrix.php }}-${{ matrix.laravel }}-${{ matrix.stability }}
restore-keys: |
${{ runner.os }}-composer-

- name: Install dependencies
run: |
composer require "illuminate/contracts:${{ matrix.laravel }}" --no-interaction --no-update
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.idea
.phpunit.result.cache
.phpunit.cache
build
composer.lock
coverage
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"require-dev": {
"guzzlehttp/guzzle": "^7.8",
"larastan/larastan": "^2.0.1",
"larastan/larastan": "^2.0|^3.0",
"laravel/pint": "^0.2.2|^1.21",
"nunomaduro/collision": "^6.0|^7.0|^8.0",
"orchestra/testbench": "^7.0|^8.0|^9.0|^10.0",
Expand Down
6 changes: 2 additions & 4 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ includes:
- phpstan-baseline.neon

parameters:
level: 4
paths:
- src
- config
inferPrivatePropertyTypeFromConstructor: true
level: 4
tmpDir: build/phpstan
checkOctaneCompatibility: true
checkModelProperties: true
checkMissingIterableValueType: false

46 changes: 22 additions & 24 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,35 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
executionOrder="random"
failOnWarning="true"
failOnRisky="true"
failOnEmptyTestSuite="true"
beStrictAboutOutputDuringTests="true"
verbose="true"
>
<testsuites>
<testsuite name="Pirsch Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<coverage>
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
<clover outputFile="build/logs/clover.xml"/>
</report>
</coverage>
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
cacheDirectory=".phpunit.cache"
backupStaticProperties="false">
<testsuites>
<testsuite name="Pirsch Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<coverage>
<report>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
<clover outputFile="build/logs/clover.xml"/>
</report>
</coverage>
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
5 changes: 5 additions & 0 deletions src/Facades/Pirsch.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

use Illuminate\Support\Facades\Facade;

/**
* @method static void track(?string $name = null, ?array $meta = null)
*
* @see \Pirsch\Pirsch
*/
class Pirsch extends Facade
{
protected static function getFacadeAccessor()
Expand Down
1 change: 1 addition & 0 deletions src/Pirsch.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public static function track(
],
);
} catch (ConnectionException) {
// remove error
}
});
}
Expand Down
Loading