Skip to content

Mage-OS Nightly Compatibilty Test #12

Mage-OS Nightly Compatibilty Test

Mage-OS Nightly Compatibilty Test #12

---
name: Mage-OS Nightly Compatibilty Test
on:
schedule:
- cron: '0 6 * * *' # run at 6 AM UTC
workflow_dispatch:
jobs:
test_develop_nightly:
name: Deploy nightly
runs-on: ubuntu-22.04
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.16.0
ports:
- 9200
- 9300
options: -e="discovery.type=single-node" --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=10
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: magento
ports:
- 3306
options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping"
steps:
- name: Checkout develop branch
uses: actions/checkout@v4.1.0
with:
ref: develop
- name: Linux Setup
run: ./.github/workflows/linux-setup.sh
- name: Dump GitHub context
run: echo "Register Github context"
env:
GITHUB_CONTEXT: ${{ toJSON(github) }}
# https://github.com/marketplace/actions/setup-php-action#matrix-setup
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
tools: composer:2.2.17
php-version: '8.1'
extensions: mbstring, intl, zip
coverage: none
- name: Install Mage-OS Nightly
run: |
# Define variables
DB_PORT="${{ job.services.mysql.ports['3306'] }}"
ES_PORT="${{ job.services.elasticsearch.ports['9200'] }}"
DB_HOST="127.0.0.1:${DB_PORT}"
# Create project
composer create-project --stability alpha --repository-url=https://upstream-nightly.mage-os.org magento/project-community-edition mage-os
# Change directory
cd mage-os
# Magento setup
bin/magento setup:install \
--db-host="$DB_HOST" \
--db-user=root \
--db-password=root \
--db-name=magento \
--cleanup-database \
--session-save=db \
--backend-frontname=admin \
--timezone="Europe/Berlin" \
--currency="EUR" \
--base-url="http://github.magerun.test/" \
--use-rewrites=1 \
--use-secure=1 \
--use-secure-admin=1 \
--admin-user=admin \
--admin-password=Password123 \
--admin-firstname=Armin \
--admin-lastname=Admin \
--admin-email="admin@example.com" \
--search-engine="elasticsearch7" \
--elasticsearch-host="127.0.0.1" \
--elasticsearch-port="$ES_PORT"
- name: Build phar file
run: |
composer --version;
bash ./build.sh;
composer self-update --rollback &> /dev/null || true;
- name: Phar functional tests (Magerun)
run: bats tests/bats/functional_magerun_commands.bats
env:
N98_MAGERUN2_TEST_MAGENTO_ROOT: "${{ github.workspace }}/mage-os"
N98_MAGERUN2_BIN: "${{ github.workspace }}/n98-magerun2.phar"
- name: Phar functional tests (Magento Core)
run: bats tests/bats/functional_core_commands.bats
env:
N98_MAGERUN2_TEST_MAGENTO_ROOT: "${{ github.workspace }}/mage-os"
N98_MAGERUN2_BIN: "${{ github.workspace }}/n98-magerun2.phar"