mirror of
https://github.com/graycoreio/github-actions-magento2.git
synced 2026-06-08 19:46:41 +00:00
feat(coding-standard): skip composer install if the coding is already installed
This commit is contained in:
@@ -40,13 +40,26 @@ inputs:
|
|||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
|
- name: Check if Coding Standard is already installed
|
||||||
|
id: check-installed
|
||||||
|
shell: bash
|
||||||
|
working-directory: ${{ inputs.path }}
|
||||||
|
run: |
|
||||||
|
if [ -d "vendor/magento/magento-coding-standard" ] || [ -d "vendor/mage-os/magento-coding-standard" ]; then
|
||||||
|
echo "installed=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "installed=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Get Composer Version
|
- name: Get Composer Version
|
||||||
uses: graycoreio/github-actions-magento2/get-composer-version@main
|
uses: graycoreio/github-actions-magento2/get-composer-version@main
|
||||||
id: get-composer-version
|
id: get-composer-version
|
||||||
|
if: steps.check-installed.outputs.installed != 'true'
|
||||||
|
|
||||||
- name: Check if allow-plugins option is available for this version of composer
|
- name: Check if allow-plugins option is available for this version of composer
|
||||||
uses: graycoreio/github-actions-magento2/semver-compare@main
|
uses: graycoreio/github-actions-magento2/semver-compare@main
|
||||||
id: is-allow-plugins-available
|
id: is-allow-plugins-available
|
||||||
|
if: steps.check-installed.outputs.installed != 'true'
|
||||||
with:
|
with:
|
||||||
version: 2.2
|
version: 2.2
|
||||||
compare_against: ${{ steps.get-composer-version.outputs.version }}
|
compare_against: ${{ steps.get-composer-version.outputs.version }}
|
||||||
@@ -55,12 +68,13 @@ runs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
working-directory: ${{ inputs.path }}
|
working-directory: ${{ inputs.path }}
|
||||||
run: composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true --global
|
run: composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true --global
|
||||||
if: steps.is-allow-plugins-available.outputs.result < 1
|
if: steps.check-installed.outputs.installed != 'true' && steps.is-allow-plugins-available.outputs.result < 1
|
||||||
|
|
||||||
- name: Install Coding Standard
|
- name: Install Coding Standard
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: ${{ inputs.path }}
|
working-directory: ${{ inputs.path }}
|
||||||
run: composer require "magento/magento-coding-standard:${{ inputs.version || '*' }}" "magento/php-compatibility-fork"
|
run: composer require "magento/magento-coding-standard:${{ inputs.version || '*' }}" "magento/php-compatibility-fork"
|
||||||
|
if: steps.check-installed.outputs.installed != 'true'
|
||||||
env:
|
env:
|
||||||
COMPOSER_AUTH: ${{ inputs.composer_auth }}
|
COMPOSER_AUTH: ${{ inputs.composer_auth }}
|
||||||
|
|
||||||
@@ -79,6 +93,7 @@ runs:
|
|||||||
fi
|
fi
|
||||||
vendor/bin/phpcs --config-set installed_paths \
|
vendor/bin/phpcs --config-set installed_paths \
|
||||||
"vendor/${CODING_STANDARD_VENDOR}/magento-coding-standard,vendor/${CODING_STANDARD_VENDOR}/php-compatibility-fork"
|
"vendor/${CODING_STANDARD_VENDOR}/magento-coding-standard,vendor/${CODING_STANDARD_VENDOR}/php-compatibility-fork"
|
||||||
|
if: steps.check-installed.outputs.installed != 'true'
|
||||||
|
|
||||||
- name: Set ignore warnings flag
|
- name: Set ignore warnings flag
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
Reference in New Issue
Block a user