Skip to content

Magento 2 Unit Tests #7

Magento 2 Unit Tests

Magento 2 Unit Tests #7

Workflow file for this run

name: Magento 2 Unit Tests
on: ['push', 'pull_request']
jobs:
unit-tests:
name: Magento 2 Unit Tests
runs-on: ubuntu-latest
container:
image: yireo/magento2installed:2.4.7-p4
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 '"'`
test -z "$COMPOSER_NAME}" && (echo "No composer name found" && exit 1)
cp -R $GITHUB_WORKSPACE /tmp/magento/package-source
cd /tmp/magento
composer config repositories.local-source path package-source/
composer require --prefer-source -W -- $COMPOSER_NAME:@dev
- name: Run Magento 2 Unit Tests
run: |
test -d $GITHUB_WORKSPACE/Test/Unit || exit 0
export COMPOSER_NAME=`cat .module.ini | grep COMPOSER_NAME | cut -f2 -d= | tr -d '"'`
cd /tmp/magento/dev/tests/unit/
php -d memory_limit=4G ../../../vendor/bin/phpunit -c phpunit.xml.dist ../../../vendor/$COMPOSER_NAME/Test/Unit