Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolves #4 : QA Pipeline #16

Closed
wants to merge 10 commits into from
38 changes: 38 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Linter

on:
pull_request:
paths:
- '*.yml'
- '*.yaml'
- '*.xml'
- '*.php'

jobs:
linter:
runs-on: ubuntu-latest

steps:

# Check out the repository
- uses: actions/checkout@v2

# Install the required version of Node.js
- uses: actions/setup-node@v1
with:
node-version: '12'

# Install the YAML, XML, and PHP linters
- run: npm install -g yaml-linter xml-linter php-linter

# Run the YAML Linter
- name: 🚀 Run YAML Linter
run: yaml-linter app/code/**/*.yml

# Run the XML Linter
- name: 🚀 Run XML Linter
run: xml-linter app/code/**/*.xml

# Run the PHP Linter
- name: 🚀 Run PHP Linter
run: php-linter app/code/**/*.php
67 changes: 67 additions & 0 deletions .github/workflows/static-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Static Magento Tests

on:
push:
branches: [2.4-develop]
pull_request:
branches: [2.4-develop]

jobs:
compute_matrix:
name: '🧮 Compute the Matrix'
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.supported-version.outputs.matrix }}
steps:
- uses: graycoreio/github-actions-magento2/supported-version@main
id: supported-version
with:
kind: latest
- run: echo ${{ steps.supported-version.outputs.matrix }}

qa:
name: '🤖 - Quality Assurance'
runs-on: ubuntu-latest
needs: compute_matrix
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.compute_matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
name: '⬇️ Checkout Code'

- uses: graycoreio/github-actions-magento2/setup-magento@main
name: '🛠 Setup Magento'
id: setup-magento
with:
php-version: ${{ matrix.php }}
magento_version: ${{ matrix.magento }}
mode: store
coverage: xDebug

- name: '🚛 Install Dependencies'
run: composer install
working-directory: ${{ steps.setup-magento.outputs.path }}
shell: bash
env:
COMPOSER_CACHE_DIR: ${{ steps.composer-cache.outputs.dir }}

- name: '👀 Get Changed Files'
uses: jitterbit/get-changed-files@v1
continue-on-error: true
id: changed-files
with:
format: space-delimited

- name: '🧠 PHP Mess Detector'
shell: bash
working-directory: ${{ steps.setup-magento.outputs.path }}
run: |
for changed_file in ${{ steps.changed-files.outputs.added_modified }}; do
if [[ ${changed_file} == *.php ]]
then
php vendor/bin/phpmd ${changed_file} github dev/tests/static/testsuite/Magento/Test/Php/_files/phpmd/ruleset.xml
else
echo "Skip for ${changed_file}"
fi
done
1 change: 1 addition & 0 deletions app/code/Magento/AdminAnalytics/etc/adminhtml/routes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
<module name="Magento_AdminAnalytics" />
</route>
</router>

</config>