forked from Smile-SA/elasticsuite
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (64 loc) · 2.62 KB
/
01-quality.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: PHP Code Quality
on:
push:
branches:
- 2.9.x
- 2.10.x
- 2.11.x
- master
pull_request_target:
branches:
- 2.9.x
- 2.10.x
- 2.11.x
- master
jobs:
qualit:
name: Code Quality
runs-on: ubuntu-20.04
strategy:
matrix:
php-versions: ['8.1']
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Prepare directories
run: mkdir -p app/etc var
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, bcmath, gd
ini-values: post_max_size=256M, max_execution_time=180
- name: "Downgrade Composer"
run: composer self-update 2.1.14
- name: Validate composer.json and composer.lock
run: composer validate
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php-versions }}
- name: Prepare credentials
env:
MAGENTO_USERNAME: ${{ secrets.MAGENTO_USERNAME }}
MAGENTO_PASSWORD: ${{ secrets.MAGENTO_PASSWORD }}
run: composer config -g http-basic.repo.magento.com "$MAGENTO_USERNAME" "$MAGENTO_PASSWORD"
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest
- name: PHP Code Sniffer with Magento Extension Quality Program
run: |
vendor/bin/phpcs --config-set installed_paths vendor/magento/marketplace-eqp/
vendor/bin/phpcs --standard=vendor/magento/marketplace-eqp/MEQP2 --severity=9 src/
- name: PHP Code Sniffer with Smile Rules
run: vendor/bin/phpcs --standard=vendor/smile/magento2-smilelab-phpcs/phpcs-standards/SmileLab --extensions=php src/
- name: PHPMD
run: vendor/bin/phpmd src text vendor/smile/magento2-smilelab-phpmd/phpmd-rulesets/rulset.xml
- name: PHPUnit
run: vendor/bin/phpunit -c Resources/tests/unit/phpunit.xml