-
Notifications
You must be signed in to change notification settings - Fork 3
executable file
·118 lines (98 loc) · 3.29 KB
/
accounts-qc-php.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Accounts Quality Control PHP
on: [pull_request]
jobs:
php-linter:
name: PHP Syntax check 5.6|7.2|7.3
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: PHP syntax checker 5.6
uses: prestashop/github-action-php-lint/5.6@master
- name: PHP syntax checker 7.2
uses: prestashop/github-action-php-lint/7.2@master
- name: PHP syntax checker 7.3
uses: prestashop/github-action-php-lint/7.3@master
php-cs-fixer:
name: PHP-CS-FIXER
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Run PHP-CS-Fixer
uses: prestashopcorp/github-action-php-cs-fixer@master
phpstan:
name: PHPStan
runs-on: ubuntu-latest
strategy:
matrix:
presta-versions: ["latest", "1.7.6.5", "1.6.1.21"]
# presta-versions: ["latest", "1.7.6.5", "1.7.0.3", "1.6.1.21", "1.6.1.0"]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache vendor folder
uses: actions/cache@v3
with:
path: vendor
key: php-${{ hashFiles('composer.lock') }}
- name: Cache composer folder
uses: actions/cache@v3
with:
path: ~/.composer/cache
key: php-composer-cache
- name: Install dependencies
run: composer install
- name: Select .neon file compatible with PrestaShop ${{ matrix.presta-versions }}
id: neon
run: |
PS_VERSION="${{ matrix.presta-versions }}"
[[ "${PS_VERSION:0:3}" != '1.6' ]] && echo ::set-output name=filename::phpstan-PS-1.7.neon || echo ::set-output name=filename::phpstan-PS-1.6.neon
- name: PHPStan PrestaShop ${{ matrix.presta-versions }}
run: |
PS_VERSION="${{ matrix.presta-versions }}" \
NEON_FILE=${{steps.neon.outputs.filename}} \
make phpstan
phpunit:
name: PHPUNIT for Prestashop ${{ matrix.presta-versions }}
runs-on: ubuntu-latest
strategy:
matrix:
presta-versions: ["1.6", "1.7", "latest"]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache vendor folder
uses: actions/cache@v3
with:
path: vendor
key: php-${{ hashFiles('composer.lock') }}
- name: Cache composer folder
uses: actions/cache@v3
with:
path: ~/.composer/cache
key: php-composer-cache
- name: Install dependencies
run: composer install
- name: PHPUnit tests
run: |
DOCKER_INTERNAL="${{ matrix.presta-versions }}" make phpunit
header-stamp:
name: Check license headers
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache vendor folder
uses: actions/cache@v3
with:
path: vendor
key: php-${{ hashFiles('composer.lock') }}
- name: Cache composer folder
uses: actions/cache@v3
with:
path: ~/.composer/cache
key: php-composer-cache
- run: composer install
- name: Run Header Stamp in Dry Run mode
run: php vendor/bin/header-stamp --license=vendor/prestashop/header-stamp/assets/afl.txt --exclude=.github,node_modules,vendor,vendor,tests,_dev --dry-run