Skip to content

Commit e0f81c2

Browse files
Moved from travis to github actions
Added phpcs and phpstan Fixed minor code styling issues related to psr12
1 parent f789140 commit e0f81c2

30 files changed

+451
-168
lines changed

.gitattributes

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
*.pdf binary
2+
*.php text eol=lf
3+
/tests export-ignore
4+
/.gitattributes export-ignore
5+
/.gitignore export-ignore
6+
/.github export-ignore
7+
/composer.lock export-ignore
8+
/phpunit.xml export-ignore
9+
/phpcs.xml export-ignore
10+
/phpstan.neon export-ignore

.github/workflows/code-style.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Code Style
2+
on: [pull_request]
3+
jobs:
4+
phpcs:
5+
name: phpcs
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Check out code into the workspace
9+
uses: actions/checkout@v2
10+
11+
- name: Install php
12+
uses: shivammathur/setup-php@v2
13+
with:
14+
php-version: "7.2"
15+
16+
- name: Install dependencies
17+
run: composer update --dev --no-interaction --prefer-dist --no-progress --no-suggest --ansi
18+
19+
- name: PHPCS check
20+
uses: chekalsky/phpcs-action@v1
21+
with:
22+
phpcs_bin_path: './vendor/bin/phpcs'
23+
enable_warnings: true
24+
25+
phpstan:
26+
name: phpstan
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Check out code into the workspace
30+
uses: actions/checkout@v2
31+
32+
- name: Install php
33+
uses: shivammathur/setup-php@v2
34+
with:
35+
php-version: "7.2"
36+
37+
- name: Install dependencies
38+
run: composer update --dev --no-interaction --prefer-dist --no-progress --no-suggest --ansi
39+
40+
- name: Run phpstan
41+
run: php ./vendor/phpstan/phpstan/phpstan.phar analyse --no-progress

.github/workflows/tests.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Tests
2+
on: [pull_request]
3+
jobs:
4+
tests:
5+
name: Run PHP Unit tests
6+
runs-on: ubuntu-20.04
7+
strategy:
8+
matrix:
9+
php: ['7.2', '7.3', '7.4']
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
14+
- name: Install php
15+
uses: shivammathur/setup-php@v2
16+
with:
17+
php-version: "${{ matrix.php }}"
18+
19+
- name: Install dependencies
20+
run: composer update --dev --no-interaction --prefer-dist --no-progress --no-suggest --ansi
21+
22+
- name: Run phpunit
23+
run: |
24+
./vendor/bin/phpunit

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/php.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.travis.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

bin/php-stub-generator

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env php
22
<?php
3+
34
declare(strict_types=1);
45

56
use setasign\PhpStubGenerator\PhpStubGenerator;

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121

2222
"require-dev": {
2323
"phpunit/phpunit": "^8.0",
24-
"php-defer/php-defer": "^4.0"
24+
"php-defer/php-defer": "^4.0",
25+
"squizlabs/php_codesniffer": "^3.5",
26+
"phpstan/phpstan": "^0.12"
2527
},
2628

2729
"autoload": {

0 commit comments

Comments
 (0)