Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion .github/workflows/_internal-coding-standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,29 @@ on:
required: true

jobs:
compute_matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.supported-version.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- uses: ./supported-version
with:
kind: all
id: supported-version
- run: echo ${{ steps.supported-version.outputs.matrix }}

coding-standard:
needs: compute_matrix
strategy:
matrix: ${{ fromJSON(needs.compute_matrix.outputs.matrix) }}
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: './coding-standard'
with:
version: ${{ github.event.inputs.version || '*' }}
path: ${{ github.event.inputs.path || '_test/demo-package' }}
path: ${{ github.event.inputs.path || '_test/demo-package' }}
composer_version: ${{ matrix.composer }}
php_version: ${{ matrix.php }}
28 changes: 28 additions & 0 deletions coding-standard/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ inputs:
default: ""
description: "The minimum severity required to display an error"

ignore_warnings:
description: 'Whether or not the action should fail on warnings, defaults to false (fails on warnings)'
default: 'false'
required: false

runs:
using: composite
steps:
Expand All @@ -57,6 +62,23 @@ runs:
tools: composer:v${{ inputs.composer_version }}
coverage: none

- name: Get Composer Version
uses: mage-os/github-actions/get-composer-version@main
id: get-composer-version

- name: Check if allow-plugins option is available for this version of composer
uses: mage-os/github-actions/semver-compare@main
with:
version: 2.2
compare_against: ${{ steps.get-composer-version.outputs.version }}
id: is-allow-plugins-available

- name: Enable dealerdirect/phpcodesniffer-composer-installer plugin
shell: bash
working-directory: standard
run: composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true --global
if: steps.is-allow-plugins-available.outputs.result < 1

- name: Install Coding Standard
shell: bash
working-directory: standard
Expand All @@ -67,6 +89,12 @@ runs:
working-directory: standard
run: vendor/bin/phpcs --config-set installed_paths ${{ github.workspace }}/standard/vendor/magento/magento-coding-standard,${{ github.workspace }}/standard/vendor/phpcompatibility/php-compatibility

- name: Set ignore warnings flag
shell: bash
working-directory: standard
run: vendor/bin/phpcs --config-set ignore_warnings_on_exit 1
if: inputs.ignore_warnings == 'true'

- name: Get Changed Files
shell: bash
working-directory: project
Expand Down