mirror of
https://github.com/graycoreio/github-actions-magento2.git
synced 2026-06-13 13:14:53 +00:00
This commit is contained in:
@@ -70,6 +70,8 @@ runs:
|
|||||||
with:
|
with:
|
||||||
list-files: shell
|
list-files: shell
|
||||||
filters: |
|
filters: |
|
||||||
|
baseline:
|
||||||
|
- modified: '**/**.{php,phtml,graphqls,less,css,html,xml,js}'
|
||||||
phpcs:
|
phpcs:
|
||||||
- added|modified: '**/**.{php,phtml,graphqls,less,css,html,xml,js}'
|
- added|modified: '**/**.{php,phtml,graphqls,less,css,html,xml,js}'
|
||||||
|
|
||||||
@@ -78,7 +80,7 @@ runs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo "One or more files relevant to PHPCS have changed."
|
echo "One or more files relevant to PHPCS have changed."
|
||||||
echo "List all the files that have changed: ${{ steps.filter.outputs.phpcs_files }}"
|
echo "List all the files that have been added or changed: ${{ steps.filter.outputs.phpcs_files }}"
|
||||||
|
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
if: steps.filter.outputs.phpcs == 'true'
|
if: steps.filter.outputs.phpcs == 'true'
|
||||||
@@ -115,17 +117,17 @@ runs:
|
|||||||
- name: Create phpcs.baseline.xml from base
|
- name: Create phpcs.baseline.xml from base
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: base
|
working-directory: base
|
||||||
if: steps.filter.outputs.phpcs == 'true'
|
if: steps.filter.outputs.baseline == 'true'
|
||||||
run: |
|
run: |
|
||||||
php ${{ github.workspace }}/magento-coding-standard/vendor/bin/phpcs --standard=Magento2 \
|
php ${{ github.workspace }}/magento-coding-standard/vendor/bin/phpcs --standard=Magento2 \
|
||||||
$([ -n "${{ inputs.severity }}" ] && echo "--severity=${{ inputs.severity }}") \
|
$([ -n "${{ inputs.severity }}" ] && echo "--severity=${{ inputs.severity }}") \
|
||||||
$([ -n "${{ inputs.warning_severity }}" ] && echo "--warning-severity=${{ inputs.warning_severity }}") \
|
$([ -n "${{ inputs.warning_severity }}" ] && echo "--warning-severity=${{ inputs.warning_severity }}") \
|
||||||
$([ -n "${{ inputs.error_severity }}" ] && echo "--error-severity=${{ inputs.error_severity }}") \
|
$([ -n "${{ inputs.error_severity }}" ] && echo "--error-severity=${{ inputs.error_severity }}") \
|
||||||
--report=\\DR\\CodeSnifferBaseline\\Reports\\Baseline --report-file=phpcs.baseline.xml \
|
--report=\\DR\\CodeSnifferBaseline\\Reports\\Baseline --report-file=phpcs.baseline.xml \
|
||||||
${{ steps.filter.outputs.phpcs_files }} || /bin/true
|
${{ steps.filter.outputs.baseline_files }} || /bin/true
|
||||||
|
|
||||||
- name: Copy baseline to head
|
- name: Copy baseline to head
|
||||||
if: steps.filter.outputs.phpcs == 'true'
|
if: steps.filter.outputs.baseline == 'true'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cp ${{ github.workspace }}/base/phpcs.baseline.xml ${{ github.workspace }}/magento-coding-standard/phpcs.baseline.xml
|
cp ${{ github.workspace }}/base/phpcs.baseline.xml ${{ github.workspace }}/magento-coding-standard/phpcs.baseline.xml
|
||||||
@@ -133,7 +135,7 @@ runs:
|
|||||||
# Since we ran phpcs in the base folder, the files in phpcs.baseline.xml contain the base folder in the path.
|
# Since we ran phpcs in the base folder, the files in phpcs.baseline.xml contain the base folder in the path.
|
||||||
# We need to remove /base/ so that the phpcs can locate the correct files.
|
# We need to remove /base/ so that the phpcs can locate the correct files.
|
||||||
- name: Remove base dir from phpcs baseline
|
- name: Remove base dir from phpcs baseline
|
||||||
if: steps.filter.outputs.phpcs == 'true'
|
if: steps.filter.outputs.baseline == 'true'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
sed -i "s|/base/|/|" ${{ github.workspace }}/magento-coding-standard/phpcs.baseline.xml
|
sed -i "s|/base/|/|" ${{ github.workspace }}/magento-coding-standard/phpcs.baseline.xml
|
||||||
|
|||||||
Reference in New Issue
Block a user