-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TPI-4331: Add workflow for mag247 and php83
- Loading branch information
1 parent
72e11d5
commit 918e001
Showing
1 changed file
with
68 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Build and Test with PHP 8.2 and Magento 2.6 | ||
|
||
on: [push, pull_request, workflow_dispatch] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 15 | ||
fail-fast: false | ||
matrix: | ||
operating-system: [ubuntu-latest] | ||
php-versions: ['8.3'] | ||
magento-versions: ['2.4.7-p2'] | ||
|
||
services: | ||
mysql: | ||
image: mysql:latest | ||
env: | ||
MYSQL_ALLOW_EMPTY_PASSWORD: false | ||
MYSQL_ROOT_PASSWORD: root | ||
MYSQL_DATABASE: magento | ||
ports: | ||
- 3306/tcp | ||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install PHP | ||
uses: shivammathur/setup-php@master | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
extensions: mbstring, gd, bcmath, ctype, curl, dom, hash, iconv, intl, openssl, simplexml, soap, xsl, zip | ||
tools: composer:v2.1 | ||
- name: Validate composer.json and composer.lock | ||
run: composer validate | ||
|
||
- name: Configure sysctl limits | ||
run: | | ||
sudo swapoff -a | ||
sudo sysctl -w vm.swappiness=1 | ||
sudo sysctl -w fs.file-max=262144 | ||
sudo sysctl -w vm.max_map_count=262144 | ||
- name: PHP Syntax Checker | ||
run: find . -type f -name '*.php' -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" ) | ||
|
||
- name: Setup Magento 2 and run tests | ||
run: | | ||
mysql -u root --password=root -h 127.0.0.1 -e 'CREATE DATABASE IF NOT EXISTS magento;' | ||
git clone --depth=1 -b ${{ matrix.magento-versions }} https://github.com/magento/magento2 /tmp/build | ||
cd /tmp/build | ||
composer update | ||
php bin/magento setup:install --base-url=http://magebuild.integrations.p1-test.de/build/ \ | ||
--db-host=127.0.0.1 --db-name=magento --db-user=root --db-password=root --admin-firstname=Dieter \ | ||
--admin-lastname=Demo --admin-email=dieterdemo@payone.com --admin-user=DieterDemo \ | ||
--admin-password=72q980hdfq2378ga9w87dg6 --language=de_DE --currency=EUR --timezone=Europe/Berlin \ | ||
--disable-modules=Magento_Elasticsearch7,Magento_Elasticsearch,Magento_OpenSearch | ||
composer require --ignore-platform-reqs payone-gmbh/magento-2 dev-master | ||
rm -rf /tmp/build/vendor/payone-gmbh/magento-2/* | ||
cp -R $GITHUB_WORKSPACE/* /tmp/build/vendor/payone-gmbh/magento-2 | ||
php bin/magento setup:upgrade | ||
php bin/magento setup:di:compile | ||
php bin/magento cache:clean | ||
sed -i 's+>allure/allure.config.php<+>dev/tests/unit/allure/allure.config.php<+g' dev/tests/unit/phpunit.xml.dist | ||
./vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist vendor/payone-gmbh/magento-2/Test/Unit | ||