add github actions
This commit is contained in:
parent
541f463059
commit
f1a7abf1e5
3 changed files with 43 additions and 1 deletions
25
.github/workflows/ci.yml
vendored
Normal file
25
.github/workflows/ci.yml
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
name: CI
|
||||||
|
on:
|
||||||
|
pull_request: null
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
jobs:
|
||||||
|
tests:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
php: ['7.3', '7.4', '8.0']
|
||||||
|
|
||||||
|
name: Linting - PHP ${{ matrix.php }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php }}
|
||||||
|
coverage: none
|
||||||
|
extensions: intl
|
||||||
|
- run: composer install --no-progress
|
||||||
|
- run: composer codestyle
|
||||||
|
- run: composer phpstan
|
||||||
|
- run: composer tests
|
||||||
|
|
@ -24,6 +24,21 @@
|
||||||
"psr-4": { "Michelf\\": "Michelf/" }
|
"psr-4": { "Michelf\\": "Michelf/" }
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": ">= 9.5"
|
"phpspec/prophecy": "^1.6",
|
||||||
|
"friendsofphp/php-cs-fixer": "^3.0",
|
||||||
|
"phpunit/phpunit": "^9.5",
|
||||||
|
"phpstan/phpstan": "^1.0",
|
||||||
|
"phpstan/phpstan-phpunit": "^1.0"
|
||||||
|
},
|
||||||
|
|
||||||
|
"scripts": {
|
||||||
|
"tests": "vendor/bin/phpunit test/",
|
||||||
|
"phpstan": [
|
||||||
|
"vendor/bin/phpstan analyse Michelf/ --level=5",
|
||||||
|
"vendor/bin/phpstan analyse -c test/phpstan.neon test/ --level=5"
|
||||||
|
],
|
||||||
|
"codestyle": "vendor/bin/php-cs-fixer fix --dry-run --verbose --show-progress=none",
|
||||||
|
"codestyle-fix": "vendor/bin/php-cs-fixer fix"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
test/phpstan.neon
Normal file
2
test/phpstan.neon
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
includes:
|
||||||
|
- ../vendor/phpstan/phpstan-phpunit/extension.neon
|
||||||
Loading…
Reference in a new issue