Magento Platform Test #244
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: Magento Platform Test | |
on: | |
push: | |
branches: | |
- 'master' | |
schedule: | |
- cron: '0 1 * * *' | |
jobs: | |
phpstan: | |
name: PHPStan Magento Integration Test | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mysql:8.0 | |
env: | |
MYSQL_ROOT_PASSWORD: root | |
ports: | |
- 3306 | |
options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
tools: composer:2.4.2 | |
php-version: 8.1 | |
extensions: mbstring, intl | |
coverage: none | |
- name: Copy PHPStanTests module to app/code | |
working-directory: ./magento | |
run: | | |
mkdir -p app/code/BitExpert | |
cp -r ../src/BitExpert_PHPStanTests/ app/code/BitExpert/PHPStanTests | |
- name: Install Composer dependencies | |
working-directory: ./magento | |
run: | |
composer install --no-interaction; | |
- name: PHPStan version | |
working-directory: ./magento | |
run: | |
./vendor/bin/phpstan --version | |
- name: Install Magento platform | |
working-directory: ./magento | |
run: | | |
mysqladmin -h127.0.0.1 -P ${{ job.services.mysql.ports[3306] }} -uroot -proot create magento; | |
bin/magento setup:install \ | |
--db-host="127.0.0.1:${{ job.services.mysql.ports[3306] }}" \ | |
--db-user=root \ | |
--db-password=root \ | |
--db-name=magento \ | |
--cleanup-database \ | |
--session-save=db \ | |
--backend-frontname=admin \ | |
--timezone="Europe/Berlin" \ | |
--currency="EUR" \ | |
--base-url="http://github.phpstan-magento.test/" \ | |
--use-rewrites=1 \ | |
--use-secure=1 \ | |
--use-secure-admin=1 \ | |
--admin-user=admin \ | |
--admin-password=Password123 \ | |
--admin-firstname=Armin \ | |
--admin-lastname=Admin \ | |
--admin-email="admin@example.com" \ | |
--disable-modules=Magento_Elasticsearch7,Magento_Elasticsearch6,Magento_Elasticsearch \ | |
--use-rewrites=1 \ | |
--no-interaction; | |
bin/magento setup:di:compile; | |
- name: Run PHPStan against app/code | |
working-directory: ./magento | |
run: | |
./vendor/bin/phpstan analyse | |
- name: Run PHPStan (Bleeding Edge) against app/code | |
working-directory: ./magento | |
run: | |
./vendor/bin/phpstan analyse -c bleedingEdge.neon |