Skip to content

Commit 1a223ec

Browse files
authored
Merge pull request #13 from hexydec/chore/maintenance
Updated `tests.yml` to upgrade PHP version and improve workflow.
2 parents ca05e53 + baa1798 commit 1a223ec

6 files changed

Lines changed: 413 additions & 218 deletions

File tree

.github/workflows/tests.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,35 @@ jobs:
99
steps:
1010
- uses: actions/checkout@v3
1111

12+
- name: Install PHP
13+
uses: shivammathur/setup-php@v2
14+
with:
15+
php-version: '8.4'
16+
extensions: mbstring xdebug
17+
coverage: xdebug
18+
19+
- name: Get Composer cache directory
20+
id: composer-cache
21+
run: echo "dir=$(composer config cache-dir)" >> $GITHUB_OUTPUT
22+
1223
- name: Cache Composer dependencies
1324
uses: actions/cache@v3
1425
with:
15-
path: /tmp/composer-cache
26+
path: ${{ steps.composer-cache.outputs.dir }}
1627
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
1728

18-
- name: Install Composer
19-
uses: php-actions/composer@v6
20-
with:
21-
php_version: 8.4
22-
php_extensions: mbstring xdebug
29+
- run: composer install --no-interaction --prefer-dist
30+
31+
- name: PHPStan Analysis
32+
run: ./vendor/bin/phpstan analyse --memory-limit=512M
2333

2434
- name: PHPUnit Tests
2535
run: ./vendor/bin/phpunit
2636
env:
27-
XDEBUG_MODE: coverage
37+
XDEBUG_MODE: coverage
38+
39+
- name: Upload coverage to Codecov
40+
uses: codecov/codecov-action@v3
41+
with:
42+
files: ./coverage/result.xml
43+
token: ${{ secrets.CODECOV_TOKEN }}

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,17 @@
1414
"keywords": ["php", "browser", "user-agents"],
1515
"minimum-stability": "stable",
1616
"require": {
17-
"php": ">=8.1"
17+
"php": ">=8.4"
1818
},
1919
"autoload": {
2020
"classmap": ["src/", "tests/"]
2121
},
2222
"scripts": {
23+
"test": "phpunit",
2324
"analyse": "phpstan analyse --memory-limit=512M"
2425
},
2526
"require-dev": {
26-
"phpunit/phpunit": "^12.5.8",
27-
"phpstan/phpstan": "^1.10"
27+
"phpunit/phpunit": "^13.0",
28+
"phpstan/phpstan": "^2.0"
2829
}
2930
}

0 commit comments

Comments
 (0)