Skip to content

Commit

Permalink
Revert "Simplified workflow"
Browse files Browse the repository at this point in the history
This reverts commit a6014a9.
  • Loading branch information
sreichel authored and cmuench committed Jul 13, 2024
1 parent d398068 commit 559dcd3
Show file tree
Hide file tree
Showing 3 changed files with 191 additions and 2 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/test-openmage-20.0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Test OpenMage 20.0.x

on: [push, pull_request]

jobs:
test-openmage-20-0-marix:
name: OpenMage ${{ matrix.openmage_version }} / PHP ${{ matrix.php_version }} / MySQL ${{ matrix.mysql_version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
openmage_version: ["20.0.20"]
php_version: ["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

- 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/"
env:
COMPOSER_VENDOR_PATH : "${{ github.workspace }}/magento/vendor"

- 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
env:
COMPOSER_VENDOR_PATH : "${{ github.workspace }}/magento/vendor"

- 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"
98 changes: 98 additions & 0 deletions .github/workflows/test-openmage-20.1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@

name: Test OpenMage 20.1.x

on: [push, pull_request]

jobs:
test-openmage-20-1-matrix:
name: OpenMage ${{ matrix.openmage_version }} / PHP ${{ matrix.php_version }} / MySQL ${{ matrix.mysql_version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
openmage_version: ["20.1.0"]
php_version: ["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

- 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/"
env:
COMPOSER_VENDOR_PATH : "${{ github.workspace }}/magento/vendor"

- 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
env:
COMPOSER_VENDOR_PATH : "${{ github.workspace }}/magento/vendor"

# Temporary allow tests to fail until code in OpenMage is fixed
continue-on-error: true

- 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"

# Temporary allow tests to fail until code in OpenMage is fixed
continue-on-error: true
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

name: Test OpenMage
name: Test OpenMage 20.10.x

on: [push, pull_request]

Expand All @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
openmage_version: ["20.0.0", "20.10.0"]
openmage_version: ["20.10.0"]
php_version: ["8.3", "8.2", "8.1", "7.4"]
mysql_version: ["8.0", "5.7"]

Expand Down

0 comments on commit 559dcd3

Please sign in to comment.