Skip to content

Commit f8ddc00

Browse files
committed
Add lint and analyse workflow and update scripts
1 parent 491b6a9 commit f8ddc00

File tree

5 files changed

+62
-4
lines changed

5 files changed

+62
-4
lines changed

.gitattributes

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Any change here will affect the distributed archive for Debian and other providers..
2-
/.github export-ignore
3-
/.gitattributes export-ignore
4-
/.gitignore export-ignore
2+
.github export-ignore
3+
.gitattributes export-ignore
4+
.gitignore export-ignore
5+
phpstan.neon.dist export-ignore
6+
phpstan-baseline.neon export-ignore
+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Lint and analyse files
2+
3+
on: [push]
4+
5+
jobs:
6+
lint-php:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v1
10+
- name: Use php 7.1
11+
uses: shivammathur/setup-php@v2
12+
with:
13+
php-version: 7.1
14+
tools: composer:v2
15+
- name: Validate composer.json and composer.lock
16+
run: composer validate
17+
- name: Cache module
18+
uses: actions/cache@v2
19+
with:
20+
path: ~/.composer/cache/
21+
key: composer-cache
22+
- name: Install dependencies
23+
run: composer install --no-interaction --prefer-dist --no-progress --no-suggest
24+
- name: Lint files
25+
run: composer run phpcs
26+
27+
analyse-php:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v1
31+
- name: Use php 7.1
32+
uses: shivammathur/setup-php@v2
33+
with:
34+
php-version: 7.1
35+
coverage: xdebug
36+
tools: composer:v2
37+
- name: Cache module
38+
uses: actions/cache@v2
39+
with:
40+
path: ~/.composer/cache/
41+
key: composer-cache
42+
- name: Install dependencies
43+
run: composer install --no-interaction --prefer-dist --no-progress --no-suggest
44+
- name: Lint files
45+
run: composer run phpstan

composer.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
],
2929
"scripts": {
3030
"test": "phpunit",
31-
"phpstan": "phpstan analyse"
31+
"phpstan": "phpstan analyse",
32+
"phpcs": "echo 'Not implemented for now';",
33+
"phpcbf": "echo 'Not implemented for now';"
3234
},
3335
"require": {
3436
"php": "^7.1 || ^8.0",

phpstan-baseline.neon

Whitespace-only changes.

phpstan.neon.dist

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
includes:
2+
- phpstan-baseline.neon
3+
parameters:
4+
level: max
5+
excludes_analyse:
6+
- vendor/*
7+
paths:
8+
- src/
9+
- tests/

0 commit comments

Comments
 (0)