Skip to content

Commit

Permalink
Add linting to prevent embarassing errors (#5209)
Browse files Browse the repository at this point in the history
* Added linting to prevent embarassing errors

Refs #5201

* Ignore unused requirements
  • Loading branch information
weirdan authored Feb 12, 2021
1 parent e476625 commit 7e61012
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,41 @@ name: Run unit tests

on: [push, pull_request]
jobs:
lint:
name: Check PHP syntax
runs-on: ubuntu-latest
steps:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.1'
tools: composer:v2

- uses: actions/checkout@v2

- name: Get Composer Cache Directories
id: composer-cache
run: |
echo "::set-output name=files_cache::$(composer config cache-files-dir)"
echo "::set-output name=vcs_cache::$(composer config cache-vcs-dir)"
- name: Cache composer cache
uses: actions/cache@v2
with:
path: |
${{ steps.composer-cache.outputs.files_cache }}
${{ steps.composer-cache.outputs.vcs_cache }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Run composer install
run: composer install -o --ignore-platform-reqs
env:
COMPOSER_ROOT_VERSION: dev-master

- run: |
vendor/bin/parallel-lint src
chunk-matrix:
name: Generate Chunk Matrix

Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"amphp/amp": "^2.4.2",
"bamarni/composer-bin-plugin": "^1.2",
"brianium/paratest": "^4.0||^6.0",
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpdocumentor/reflection-docblock": "^5",
"phpmyadmin/sql-parser": "5.1.0||dev-master",
"phpspec/prophecy": ">=1.9.0",
Expand Down

0 comments on commit 7e61012

Please sign in to comment.