Add native php linting into CI
authorPhilipp <admin@philipp.info>
Mon, 5 Apr 2021 17:07:54 +0000 (19:07 +0200)
committerPhilipp <admin@philipp.info>
Mon, 5 Apr 2021 17:08:57 +0000 (19:08 +0200)
.github/workflows/lint.yml [new file with mode: 0644]
composer.json

diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
new file mode 100644 (file)
index 0000000..3fb324b
--- /dev/null
@@ -0,0 +1,20 @@
+name: Lint
+on: pull_request
+
+jobs:
+  php-linters:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        php-versions: ['7.3', '7.4', '8.0']
+    name: php${{ matrix.php-versions }} lint
+    steps:
+      - name: Checkout
+        uses: actions/checkout@master
+      - name: Set up php${{ matrix.php-versions }}
+        uses: shivammathur/setup-php@master
+        with:
+          php-version: ${{ matrix.php-versions }}
+          coverage: none
+      - name: Lint
+        run: bin/composer.phar run lint
index 569c304..f2e780a 100644 (file)
                "mikey179/vfsstream": "^1.6"
        },
        "scripts": {
-               "test": "phpunit"
+               "test": "phpunit",
+               "lint": "find . -name \\*.php -not -path './vendor/*' -not -path './view/asset/*' -print0 | xargs -0 -n1 php -l"
        }
 }