diff --git a/workflow-templates/coding-standards.properties.json b/workflow-templates/coding-standards.properties.json new file mode 100644 index 0000000..f8c1fbc --- /dev/null +++ b/workflow-templates/coding-standards.properties.json @@ -0,0 +1,11 @@ +{ + "name": "Coding standards", + "description": "Enforces Doctrine Coding Standard", + "iconName": "doctrine-logo", + "categories": [ + "PHP" + ], + "filePatterns": [ + "^phpcs\\.xml(?:\\.dist)$" + ] +} diff --git a/workflow-templates/coding-standards.yml b/workflow-templates/coding-standards.yml new file mode 100644 index 0000000..4736f4a --- /dev/null +++ b/workflow-templates/coding-standards.yml @@ -0,0 +1,40 @@ + +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" + + # Remove -q when updating to phpcs v4 + # https://github.com/staabm/annotate-pull-request-from-checkstyle/pull/44 + - name: "Run PHP_CodeSniffer" + run: "vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr" diff --git a/workflow-templates/doctrine-logo.svg b/workflow-templates/doctrine-logo.svg new file mode 100644 index 0000000..9baa811 --- /dev/null +++ b/workflow-templates/doctrine-logo.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + \ No newline at end of file