Skip to content

Commit b730036

Browse files
authored
Merge pull request #166 from janedbal/phpstan-ci
Setup basic CI
2 parents ca47694 + 5080d25 commit b730036

6 files changed

Lines changed: 560 additions & 1756 deletions

File tree

.github/workflows/checks.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Checks
2+
on:
3+
pull_request:
4+
push:
5+
6+
jobs:
7+
checks:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
php-version: [ '7.2', '7.3', '7.4', '8.0', '8.1' ]
13+
dependency-version: [ prefer-lowest, prefer-stable ]
14+
steps:
15+
-
16+
name: Checkout code
17+
uses: actions/checkout@v2
18+
-
19+
name: Setup PHP
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: ${{ matrix.php-version }}
23+
-
24+
name: Install composer
25+
run: composer update --no-progress --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
26+
-
27+
name: Run lint
28+
run: composer lint
29+
30+
- name: Run tests
31+
run: composer test
32+
-
33+
name: Run phpstan
34+
run: composer check

composer.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@
2323
"php": "^7.2 || ^8.0"
2424
},
2525
"require-dev": {
26-
"squizlabs/php_codesniffer": "^3.4",
27-
"phpunit/phpunit": "^8.3",
26+
"squizlabs/php_codesniffer": "^3.6",
27+
"phpstan/phpstan": "^1.4",
28+
"phpunit/phpunit": "^8.5.23",
2829
"php-coveralls/php-coveralls": "^2.1"
2930
},
3031
"scripts": {
@@ -35,7 +36,8 @@
3536
"lint:psr2": "phpcs --standard=PSR2 src/**",
3637
"lint:self": "./bin/ec",
3738
"test": "phpunit tests/ --bootstrap vendor/autoload.php --colors=always",
38-
"test:coverage": "phpunit -c ./phpunit.xml.dist"
39+
"test:coverage": "phpunit -c ./phpunit.xml.dist",
40+
"check": "phpstan analyse -vvv"
3941
},
4042
"bin": [
4143
"bin/editorconfig-checker",

0 commit comments

Comments
 (0)