Skip to content

Commit

Permalink
Introduce coding standards workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
greg0ire committed Aug 22, 2020
1 parent 6c81f60 commit 9561432
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions workflow-templates/coding-standards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

name: "Coding Standards"

on: ["pull_request", "push"]

jobs:
coding-standards:
name: "Coding Standards"
runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

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

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v2"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"

- name: "Install dependencies with composer"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Run PHP Code Beautifier"
run: "vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr"

0 comments on commit 9561432

Please sign in to comment.