-
Notifications
You must be signed in to change notification settings - Fork 224
108 lines (94 loc) · 3.56 KB
/
mage-os_nightly_test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
---
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"