Fix CI #74
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PHPStan | |
on: [workflow_dispatch, pull_request] | |
env: | |
PLUGIN_NAME: DataMigration42 | |
DATABASE_URL: mysql://root:[email protected]: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@master | |
- name: Setup PHP, with composer and extensions | |
uses: shivammathur/setup-php@master #https://github.com/shivammathur/setup-php | |
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 "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Cache composer dependencies | |
uses: actions/cache@v2 | |
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 |