-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (86 loc) · 3.11 KB
/
phpstan.yaml
File metadata and controls
97 lines (86 loc) · 3.11 KB
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
name: PHPStan
on: [workflow_dispatch, pull_request]
env:
PLUGIN_NAME: DataMigration43
DATABASE_URL: mysql://root:root@127.0.0.1:3306/eccube_db
DATABASE_SERVER_VERSION: 5
jobs:
phpstan:
name: PHPStan
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
eccube_version: ["4.2", "4.3"]
php: ["7.4", "8.0", "8.1", "8.2", "8.3"]
exclude:
- eccube_version: 4.2
php: 8.2
- eccube_version: 4.2
php: 8.3
- eccube_version: 4.3
php: 7.4
- eccube_version: 4.3
php: 8.0
services:
mysql:
image: mysql:8
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_USER: root
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: eccube_db
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, xml, ctype, iconv, mysql, intl
tools: composer:v2
- name: Clone EC-CUBE
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ECCUBE_VERSION: ${{ matrix.eccube_version }}
run: |
tar cvzf $HOME/${PLUGIN_NAME}.tar.gz ./*
git clone https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/EC-CUBE/ec-cube.git -b ${ECCUBE_VERSION} --depth=1
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: |
cd ec-cube
composer install --no-progress --prefer-dist --optimize-autoloader
composer require pear/pear-core-minimal:^1.10.0alpha2
composer require pear/archive_tar:^1.4.3
composer require wapmorgan/unified-archive:^0.0.3
composer require nobuhiko/bulk-insert-query
- name: Setup EC-CUBE
run: |
cd ec-cube
bin/console doctrine:schema:create
bin/console eccube:fixtures:load
- name: Install Plugin
run: |
cd ec-cube
bin/console eccube:plugin:install --path=$HOME/${PLUGIN_NAME}.tar.gz
bin/console cache:clear --no-warmup
bin/console eccube:plugin:enable --code=${PLUGIN_NAME}
- name: PHPStan
run: |
cd ec-cube
composer require phpstan/phpstan --dev
vendor/bin/phpstan analyze -l 1 app/Plugin/${PLUGIN_NAME} --error-format=github