Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added an initial PHP linting github action #11

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
38 changes: 38 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: PHP Linting

on: [push]

jobs:
lint:

runs-on: ubuntu-latest
strategy:
matrix:
php: [7.3, 7.4]
steps:
- uses: actions/checkout@v2

- name: PHP Version
run: php --version

- name: Lint PHP Files
run: find . -name "*.php" -print0 | xargs -0 -n1 php -l

- name: Lint PHP Files ( 8 threads )
run: find . -name "*.php" -print0 | xargs -0 -n1 -P8 php -l

# - name: Cache composer dependencies
# uses: actions/cache@v1
# with:
# path: vendor
# key: composer-${{ hashFiles('composer.lock') }}


- name: Validate composer.json and composer.lock
run: ls composer.json > /dev/null && composer validate

- name: Composer Install
run: ls composer.json > /dev/null && composer install

- name: Run PHPUnit tests
run: ls vendor/bin/phpunit > /dev/null && ./vendor/bin/phpunit
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"description": "Takes stock of a local install and generates a composer.json",
"license": "GPL-2.0+",
"type": "wordpress-plugin",
"version": "dev-master",
"authors": [
{
"name": "Tom J Nowell",
Expand Down