From d2af8e9b90e844dd6a2fc669468b9672ba347c05 Mon Sep 17 00:00:00 2001 From: Mikel Martin Date: Wed, 7 Feb 2024 13:00:17 +0100 Subject: [PATCH] Composer action --- .github/workflows/main.yml | 24 +++++++++++++----------- Test/Unit/bootstrap.php | 17 +++++------------ 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0363cef..e8a937a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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() diff --git a/Test/Unit/bootstrap.php b/Test/Unit/bootstrap.php index 5f88d24..61c1017 100644 --- a/Test/Unit/bootstrap.php +++ b/Test/Unit/bootstrap.php @@ -1,19 +1,12 @@ 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);