From 5498fc4abdb2efd6781ea2477df13911a5a0930d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20M=C3=BCnch?= Date: Thu, 6 Jun 2024 16:40:51 +0200 Subject: [PATCH] Add OpenMage 20.9 to the test setup --- .github/workflows/test-openmage-20.9.yml | 90 ++++++++++++++++++++++++ config.yaml | 5 ++ 2 files changed, 95 insertions(+) create mode 100644 .github/workflows/test-openmage-20.9.yml diff --git a/.github/workflows/test-openmage-20.9.yml b/.github/workflows/test-openmage-20.9.yml new file mode 100644 index 000000000..224d171ad --- /dev/null +++ b/.github/workflows/test-openmage-20.9.yml @@ -0,0 +1,90 @@ + +name: Test OpenMage 20.9.x + +on: [push, pull_request] + +jobs: + test-openmage-20-9-matrix: + name: OpenMage ${{ matrix.openmage_version }} / PHP ${{ matrix.php_version }} / MySQL ${{ matrix.mysql_version }} + # Job is currently disabled until we know why the build matrix fails but the local ddev setup no + if: false + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + openmage_version: ["20.9.0"] + php_version: ["8.3", "8.2", "8.1", "7.4"] + mysql_version: ["8.0", "5.7"] + + services: + mysql: + image: mysql:${{ matrix.mysql_version }} + env: + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: magento_test_db + ports: + - 3306:3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + + steps: + - uses: actions/checkout@v4 + + - name: Linux Setup + run: ./.github/workflows/linux-setup.sh + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php_version }} + extensions: yaml + coverage: none + + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: | + ~/.cache/composer + vendor + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- + + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-suggest + + - name: Validate mysql service + run: | + echo "Checking mysql service" + sudo apt-get install -y mysql-client + mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports['3306'] }} -uroot -proot -e "SHOW DATABASES" + + - name: Install OpenMage + run: | + php bin/n98-magerun --no-interaction install \ + --magentoVersionByName="openmage-${{ matrix.openmage_version }}" \ + --installationFolder="./magento" \ + --dbHost="127.0.0.1" \ + --dbPort="${{ job.services.mysql.ports['3306'] }}" \ + --dbUser="root" \ + --dbPass="root" \ + --dbName="magento_test_db" \ + --installSampleData=no \ + --useDefaultConfigParams=yes \ + --baseUrl="http://magento.local/" + + - name: Set Magento root environment variable + run: echo "N98_MAGERUN_TEST_MAGENTO_ROOT=${{ github.workspace }}/magento" >> $GITHUB_ENV + + - name: Run tests + run: php -f vendor/bin/phpunit + + - name: Report coverage + uses: codecov/codecov-action@v4 + with: + file: ./build/coverage/clover.xml + + - name: Run functional tests + run: bats tests/bats/functional.bats + env: + N98_MAGERUN_BIN: "${{ github.workspace }}/bin/n98-magerun" + N98_MAGERUN_TEST_MAGENTO_ROOT: "${{ github.workspace }}/magento" diff --git a/config.yaml b/config.yaml index 3966ba11f..1a0fa9ec1 100644 --- a/config.yaml +++ b/config.yaml @@ -170,6 +170,11 @@ commands: N98\Magento\Command\Installer\InstallCommand: magento-packages: + - name: openmage-20.9.0 + package: openmage/magento-lts + version: 20.9.0 + extra: + sample-data: sample-data-1.9.2.4 - name: openmage-20.1.0 package: openmage/magento-lts version: 20.1.0