Skip to content
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

Add phpstan and require PHP 8 / Laravel 9 #9

Merged
merged 13 commits into from
Dec 4, 2022
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
39 changes: 13 additions & 26 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,27 @@ on:
push:
paths-ignore:
- '**/*.md'
- '**/*.markdown'
pull_request:
paths-ignore:
- '**/*.md'
- '**/*.markdown'

jobs:
tests:
runs-on: ${{ matrix.operating-system }}
runs-on: ubuntu-latest
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository)

strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-20.04]
php-versions: ['7.4', '8.0', '8.1']
dependencies: ['no', 'low', 'beta']
exclude:
- operating-system: ubuntu-20.04
php-versions: '8.1'
dependencies: 'low'

name: PHP ${{ matrix.php-versions }} - ${{ matrix.dependencies }}
php-versions: ['8.0', '8.1', '8.2']

name: PHP ${{ matrix.php-versions }}

env:
COMPOSER_NO_INTERACTION: 1
extensions: curl json libxml dom
extensions: curl, json, libxml, dom
key: cache-v1 # can be any string, change to clear the extension cache.

steps:
Expand Down Expand Up @@ -59,20 +55,13 @@ jobs:
path: ~/.composer/cache/files
key: dependencies-composer-${{ hashFiles('composer.json') }}

- name: Fix beta
if: ${{ matrix.dependencies == 'beta' }}
run: perl -pi -e 's/^}$/,"minimum-stability":"beta"}/' composer.json

- name: Setup PHP Action
uses: shivammathur/setup-php@2.8.0
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
coverage: xdebug
tools: pecl, composer

- name: PHP Show modules
run: php -m

- name: Get composer cache directory
id: composer-cache
Expand All @@ -86,15 +75,13 @@ jobs:
restore-keys: ${{ runner.os }}-composer-

- name: Install Composer dependencies
if: ${{ matrix.dependencies != 'low' }}
run: composer update --no-interaction

- name: Install Composer dependencies
if: ${{ matrix.dependencies == 'low' }}
run: composer update -vvv --prefer-lowest --prefer-stable --no-interaction
run: composer install --no-interaction

- name: Validate files
run: composer validate-files

- name: Run PHPStan
run: composer phpstan

- name: Run tests
run: composer run-tests
run: composer run-tests
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/vendor
/.idea
composer.phar
composer.lock
.DS_Store
.php-cs-fixer.cache
.phpunit.result.cache
32 changes: 27 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@
}
],

"repositories": [
{
"type": "vcs",
"url": "https://github.com/LycheeOrg/phpstan-lychee"
}
],

"require": {
"php": "^7.2.5|^8.0",
"illuminate/support": "^7.0|^8.0|^9.0",
"illuminate/database": "^7.0|^8.0|^9.0",
"illuminate/events": "^7.0|^8.0|^9.0"
"php": "^8.0",
"illuminate/support": "^9.0",
"illuminate/database": "^9.0",
"illuminate/events": "^9.0"
},

"autoload": {
Expand All @@ -26,7 +33,10 @@

"require-dev": {
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpunit/phpunit": "^9.5.20"
"phpunit/phpunit": "^9.5.20",
"lychee-org/phpstan-lychee": "dev-master",
"nunomaduro/larastan": "^2.0",
"orchestra/testbench": "^7.15"
},

"scripts": {
Expand All @@ -36,11 +46,23 @@
],
"validate-files": [
"vendor/bin/parallel-lint --exclude vendor ."
],
"phpstan": [
"vendor/bin/phpstan analyze"
]
},
"minimum-stability": "dev",
"prefer-stable": true,

"config": {
"platform": {
"php": "8.0.2"
},
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
},

"extra": {
"branch-alias": {
"dev-master": "v5.0.x-dev"
Expand Down
Loading