Skip to content

1.0.2

1.0.2 #4

name: Magento 2 Integration Tests
#on: ['push', 'pull_request']
on:
release:
push:
branches:
- 'main'
jobs:
integration-tests:
name: Magento 2 Integration Tests
runs-on: self-hosted
#runs-on: ubuntu-latest
container:
image: yireo/magento2installed:2.4.7-p4
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: magento2
MYSQL_PASSWORD: magento2
MYSQL_DATABASE: magento2
options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping"
opensearch:
image: yireo/opensearch-dummy
env:
'discovery.type': single-node
'xpack.security.enabled': false
ES_JAVA_OPTS: "-Xms128m -Xmx128m"
options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
image: redis
options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Add module source
run: |
export COMPOSER_NAME=`cat .module.ini | grep COMPOSER_NAME | cut -f2 -d= | tr -d '"'`
cp -R ${GITHUB_WORKSPACE} /tmp/magento/package-source
cd /tmp/magento
composer config repositories.local-source path package-source/
composer require --prefer-source -- ${COMPOSER_NAME}:@dev yireo/magento2-integration-test-helper
- name: Run Magento 2 Integration Tests
run: |
test -d $GITHUB_WORKSPACE/Test/Integration || exit 0
export EXTENSION_VENDOR=`cat .module.ini | grep EXTENSION_VENDOR | cut -f2 -d= | tr -d '"'`
export EXTENSION_NAME=`cat .module.ini | grep EXTENSION_NAME | cut -f2 -d= | tr -d '"'`
export COMPOSER_NAME=`cat .module.ini | grep COMPOSER_NAME | cut -f2 -d= | tr -d '"'`
export MAGENTO_MODULE=${EXTENSION_VENDOR}_${EXTENSION_NAME}
cd /tmp/magento/dev/tests/integration/
cp -R ${GITHUB_WORKSPACE}/.github/workflows/integration-tests/* .
php -d memory_limit=4G ../../../vendor/bin/phpunit -c phpunit.xml ../../../vendor/$COMPOSER_NAME/Test/Integration