Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TPI-4331: Github workflows #565

Merged
merged 15 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 0 additions & 70 deletions .github/workflows/build.yml

This file was deleted.

62 changes: 0 additions & 62 deletions .github/workflows/build_magento23.yml

This file was deleted.

72 changes: 72 additions & 0 deletions .github/workflows/magento244.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Magento 2.4.4-p11 with PHP 8.1

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.1']
magento-versions: ['2.4.4-p11']

services:
mysql:
image: mysql:8.0
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: magento
ports:
- 4444: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@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, gd, bcmath, ctype, curl, dom, hash, iconv, intl, openssl, simplexml, soap, xsl, zip
tools: composer:v2.8
- 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: Runs Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 7.6.0

- 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 --user=root --password=root --host=127.0.0.1 --port=4444 -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:4444 --db-name=magento --db-user=root --db-password=root --admin-firstname=Dieter \
--admin-lastname=Demo [email protected] --admin-user=DieterDemo \
--admin-password=72q980hdfq2378ga9w87dg6 --language=de_DE --currency=EUR --timezone=Europe/Berlin \
--search-engine=elasticsearch7 --elasticsearch-host=localhost \
--elasticsearch-port=9200
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
./vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist vendor/payone-gmbh/magento-2/Test/Unit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Test with Magento 2.4
name: Magento 2.4.5-p10 with PHP 8.1

on: [push, pull_request, workflow_dispatch]

Expand All @@ -12,24 +12,27 @@ jobs:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.1']
magento-versions: ['2.4.4']
magento-versions: ['2.4.5-p10']

services:
mysql:
image: mysql:8.0.20
image: mysql:8.0
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: magento
ports:
- 3306:3306
- 4444: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
uses: shivammathur/setup-php@v2
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
tools: composer:v2.8
- name: Validate composer.json and composer.lock
run: composer validate

Expand All @@ -50,12 +53,12 @@ jobs:

- 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;'
mysql --user=root --password=root --host=127.0.0.1 --port=4444 -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 \
--db-host=127.0.0.1:4444 --db-name=magento --db-user=root --db-password=root --admin-firstname=Dieter \
--admin-lastname=Demo [email protected] --admin-user=DieterDemo \
--admin-password=72q980hdfq2378ga9w87dg6 --language=de_DE --currency=EUR --timezone=Europe/Berlin \
--search-engine=elasticsearch7 --elasticsearch-host=localhost \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Test with PHP 8.2 and Magento 2.6
name: Magento 2.4.6-p8 with PHP 8.1 and 8.2

on: [push, pull_request, workflow_dispatch]

Expand All @@ -11,25 +11,28 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.2']
magento-versions: ['2.4.6']
php-versions: ['8.1', '8.2']
magento-versions: ['2.4.6-p8']

services:
mysql:
image: mysql:8.0.20
image: mysql:8.0
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: magento
ports:
- 3306:3306
- 4444: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
uses: shivammathur/setup-php@v2
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
tools: composer:v2.8
- name: Validate composer.json and composer.lock
run: composer validate

Expand All @@ -45,12 +48,12 @@ jobs:

- 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;'
mysql --user=root --password=root --host=127.0.0.1 --port=4444 -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 \
--db-host=127.0.0.1:4444 --db-name=magento --db-user=root --db-password=root --admin-firstname=Dieter \
--admin-lastname=Demo [email protected] --admin-user=DieterDemo \
--admin-password=72q980hdfq2378ga9w87dg6 --language=de_DE --currency=EUR --timezone=Europe/Berlin \
--disable-modules=Magento_Elasticsearch7,Magento_Elasticsearch,Magento_OpenSearch
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/magento247.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Magento 2.4.7-p3 with PHP 8.2 and 8.3

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.2','8.3']
magento-versions: ['2.4.7-p3']

services:
mysql:
image: mysql:8.0
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: magento
ports:
- 4444: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@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, gd, bcmath, ctype, curl, dom, hash, iconv, intl, openssl, simplexml, soap, xsl, zip
tools: composer:v2.8
- 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 --user=root --password=root --host=127.0.0.1 --port=4444 -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:4444 --db-name=magento --db-user=root --db-password=root --admin-firstname=Dieter \
--admin-lastname=Demo [email protected] --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
./vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist vendor/payone-gmbh/magento-2/Test/Unit

Loading