-
Notifications
You must be signed in to change notification settings - Fork 22
81 lines (80 loc) · 3.69 KB
/
magento-installation.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
name: Magento installation
on: [push]
defaults:
run:
shell: bash
jobs:
magento-installation:
name: Magento 2 Test Install
runs-on: ubuntu-latest
container: yireo/magento2base:7.4
services:
es:
image: docker.elastic.co/elasticsearch/elasticsearch:7.8.0
ports:
- 9200:9200
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:5.7
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: magento2
ports:
- 3306:3306
options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v2
- name: Composer preparation
env:
MAGENTO_MARKETPLACE_USERNAME: ${{ secrets.MAGENTO_MARKETPLACE_USERNAME }}
MAGENTO_MARKETPLACE_PASSWORD: ${{ secrets.MAGENTO_MARKETPLACE_PASSWORD }}
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mkdir -p /tmp/m2 && cd /tmp/m2
composer global config github-oauth.github.com $COMPOSER_TOKEN
composer global config http-basic.repo.magento.com $MAGENTO_MARKETPLACE_USERNAME $MAGENTO_MARKETPLACE_PASSWORD
- name: Creating Magento composer project
run: |
MAGENTO_VERSION=`cat ${GITHUB_WORKSPACE}/.github/workflows/magento_version.txt`
test -z "$MAGENTO_VERSION" && exit 1
composer create-project --repository=https://repo.magento.com/ magento/project-community-edition:${MAGENTO_VERSION} /tmp/m2 --no-install --no-interaction --no-progress
- name: Setup local composer package
env:
COMPOSER_NAME: ${{ secrets.COMPOSER_NAME }}
run: |
MAGENTO_VERSION=`cat ${GITHUB_WORKSPACE}/.github/workflows/magento_version.txt`
BRANCH=magento-`echo $MAGENTO_VERSION | cut -f'1-2' -d\.`
test -z "$MAGENTO_VERSION" && exit 1
cd /tmp/m2
ln -s ${GITHUB_WORKSPACE} local-source
composer config preferred-install source
composer config minimum-stability dev
composer config repositories.remote-source vcs [email protected]:${COMPOSER_NAME}.git
composer config repositories.local-source path local-source/
echo "Installing ${COMPOSER_NAME}:dev-${BRANCH}"
composer require ${COMPOSER_NAME}:dev-${BRANCH} --no-update --no-interaction
- name: Composer installation
run: |
cd /tmp/m2
COMPOSER_MEMORY_LIMIT=-1 composer install --prefer-source --no-interaction --no-progress --no-suggest --no-dev
- name: Magento installation
run: |
cd /tmp/m2
php -d memory_limit=2G bin/magento setup:install --base-url=http://magento2.test/ \
--db-host=mysql --db-name=magento2 \
--db-user=root --db-password=root \
--admin-firstname=John --admin-lastname=Doe \
--admin-user=johndoe --admin-password=johndoe!1234 \
--backend-frontname=admin --language=en_US \
--currency=USD --timezone=Europe/Amsterdam --cleanup-database \
--sales-order-increment-prefix="ORD$" --session-save=db \
--use-rewrites=1 --elasticsearch-host=es
- name: Magento compilation
run: |
cd /tmp/m2
php -d memory_limit=2G bin/magento setup:di:compile
- name: Additional checks
run: |
cd /tmp/m2
bin/magento module:status | sort