Skip to content

Commit

Permalink
Composer action
Browse files Browse the repository at this point in the history
  • Loading branch information
m1k3lm committed Feb 7, 2024
1 parent fb4a79f commit d2af8e9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 23 deletions.
24 changes: 13 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,21 @@ jobs:
- uses: actions/checkout@v3
with:
path: magento/vendor/sequra/magento2-core

- uses: "shivammathur/setup-php@v2"
- uses: "ramsey/composer-install@v2"
with:
php-version: "8.2"
working-directory: magento/vendor/sequra/magento2-core
composer-options: "--no-interaction --no-progress --no-suggest --prefer-dist"
# - uses: "shivammathur/setup-php@v2"
# with:
# php-version: "8.2"

- name: 'Prepare for unit test'
working-directory: magento/vendor/sequra/magento2-core
env:
COMPOSER_AUTH: ${{ steps.composer_auth.outputs.auth }}
run: |
../../../vendor/bin/composer install
ls -l vendor/sequra
cp -r vendor/sequra/* ../../../vendor/sequra/
# - name: 'Prepare for unit test'
# working-directory: magento/vendor/sequra/magento2-core
# env:
# COMPOSER_AUTH: ${{ steps.composer_auth.outputs.auth }}
# run: |
# ../../../vendor/bin/composer install

- name: 'launch magento2 unit test'
if: always()
Expand Down
17 changes: 5 additions & 12 deletions Test/Unit/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
<?php
use Magento\Framework\App\Bootstrap;
use Magento\Framework\App\Cron;
// Load Composer's autoloader
require_once __DIR__ . '/../../../../autoload.php';
// Register namespaces for autoloading
$loader = new \Composer\Autoload\ClassLoader();

// Add namespaces from your module's composer.json file
$loader->addPsr4('SeQura\\Core\\Tests\\Infrastructure\\', __DIR__ . '/../../../integration-core/tests/Infrastructure');
$loader->addPsr4('SeQura\\Core\\Tests\\BusinessLogic\\', __DIR__ . '/../../../integration-core/tests/BusinessLogic');

// Register the loader
$loader->register();

// Load magento's booststrap
require __DIR__ . '/../../../../../app/bootstrap.php';

if (file_exists(__DIR__ . '/vendor/composer/autoload.php')) {
include __DIR__ . '/vendor/composer/autoload.php';
}

$bootstrap = Bootstrap::create(BP, $_SERVER);
$bootstrap->createApplication(Cron::class);

0 comments on commit d2af8e9

Please sign in to comment.