Skip to content

Commit

Permalink
Lint against all supported PHP versions
Browse files Browse the repository at this point in the history
  • Loading branch information
live627 committed Feb 12, 2022
1 parent 0a4fbec commit bc2b256
Show file tree
Hide file tree
Showing 3 changed files with 198 additions and 567 deletions.
38 changes: 33 additions & 5 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: PHP Check

on:
push:
branches:
- '*'
pull_request:
branches:
- release-2.1
pull_request:

jobs:
build:
Expand All @@ -23,7 +23,7 @@ jobs:

- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest
run: composer install --prefer-dist --no-progress --ansi

- run: php -v

Expand All @@ -37,5 +37,33 @@ jobs:
php ./vendor/simplemachines/build-tools/check-smf-languages.php
php ./vendor/simplemachines/build-tools/check-version.php
lint:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ 7.0, 7.1, 7.2, 7.3, 7.4, 8.0 ]

name: PHP ${{ matrix.php }} Syntax Check
steps:
- uses: actions/checkout@v2

- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-php-

- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --ansi

- name: Lint PHP files
run: vendor/bin/phplint . --exclude=vendor -w
run: vendor/bin/phplint -w --exclude .git --exclude vendor --ansi .
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,10 @@
"prefer-stable": true,
"require-dev": {
"simplemachines/build-tools": "dev-master"
},
"config": {
"platform": {
"php": "7.0.2"
}
}
}
Loading

0 comments on commit bc2b256

Please sign in to comment.