Mage-OS Nightly Compatibilty Test #572
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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: | |
elaticsearch: | |
image: docker.elastic.co/elasticsearch/elasticsearch:7.9.0 | |
# we bind the port to the host because the n98-magerun2 install command does not support to pass | |
# ES variables. So we cannot pass the random port via GitHub Action template variable. | |
ports: | |
- 9200:9200 | |
- 9300: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/[email protected] | |
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.5 | |
php-version: '8.2' | |
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://repo.mage-os.org mage-os/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="[email protected]" \ | |
--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" |