Skip to content
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
30 changes: 23 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,35 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: mbstring xdebug
coverage: xdebug

- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-dir)" >> $GITHUB_OUTPUT

- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: /tmp/composer-cache
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}

- name: Install Composer
uses: php-actions/composer@v6
with:
php_version: 8.4
php_extensions: mbstring xdebug
- run: composer install --no-interaction --prefer-dist

- name: PHPStan Analysis
run: ./vendor/bin/phpstan analyse --memory-limit=512M

- name: PHPUnit Tests
run: ./vendor/bin/phpunit
env:
XDEBUG_MODE: coverage
XDEBUG_MODE: coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage/result.xml
token: ${{ secrets.CODECOV_TOKEN }}
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@
"keywords": ["php", "browser", "user-agents"],
"minimum-stability": "stable",
"require": {
"php": ">=8.1"
"php": ">=8.4"
},
"autoload": {
"classmap": ["src/", "tests/"]
},
"scripts": {
"test": "phpunit",
"analyse": "phpstan analyse --memory-limit=512M"
},
"require-dev": {
"phpunit/phpunit": "^12.5.8",
"phpstan/phpstan": "^1.10"
"phpunit/phpunit": "^13.0",
"phpstan/phpstan": "^2.0"
}
}
Loading
Loading