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 86ab86f
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
11 changes: 11 additions & 0 deletions workflow-templates/coding-standards.properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "Coding standards",
"description": "Enforces doctrine/coding-standard",
"iconName": "doctrine-logo",
"categories": [
"PHP"
],
"filePatterns": [
"^phpcs\\.xml(?:\\.dist)$"
]
}
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-20.04"

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_CodeSniffer"
run: "vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr"
30 changes: 30 additions & 0 deletions workflow-templates/doctrine-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 86ab86f

Please sign in to comment.