-
Notifications
You must be signed in to change notification settings - Fork 7
76 lines (65 loc) · 3.56 KB
/
Copy pathcompile.yml
File metadata and controls
76 lines (65 loc) · 3.56 KB
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
name: Magento 2 DI compilation
on: ['push', 'pull_request']
jobs:
compile:
name: Magento 2 DI compilation
runs-on: ubuntu-latest
strategy:
matrix:
magento_version: ['2.4.7-p7', '2.4.8-p1', '2.4.8-p4', '2.4.9']
container:
image: yireo/magento2installed:${{ matrix.magento_version }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Testing for MODULE.json file
run: |
(test -f MODULE.json || echo "SKIP_JOB=true" >> $GITHUB_ENV) || true
- name: Check Magento version
if: env.SKIP_JOB != 'true'
run: |
jq -e --arg v "${{ matrix.magento_version }}" '.skip_magento_versions[]? | select(. == $v)' MODULE.json && echo "SKIP_JOB=true" >> $GITHUB_ENV || true
- name: Cleanup PHP
if: env.SKIP_JOB != 'true'
run: |
test -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini || true
- name: Setting up module variables
if: env.SKIP_JOB != 'true'
run: |
echo COMPOSER_NAME=`jq '.name' composer.json -r` >> $GITHUB_ENV
echo MAGENTO_MODULE=`jq '.module_name' MODULE.json -r` >> $GITHUB_ENV
- name: Configure GitLab
if: env.SKIP_JOB != 'true'
run: |
test -n "${{ secrets.GITLAB_TOKEN }}" || exit 0
cd /tmp/magento
composer config gitlab-domains gitlab.yireo.com
composer config --global --auth gitlab-token.gitlab.yireo.com "${{ secrets.GITLAB_TOKEN }}"
composer config repositories.loki-third-party composer https://gitlab.yireo.com/api/v4/group/loki-third-party/-/packages/composer/packages.json
composer config repositories.loki-checkout composer https://gitlab.yireo.com/api/v4/group/loki-checkout/-/packages/composer/packages.json
composer config repositories.loki-checkout-dev composer https://gitlab.yireo.com/api/v4/group/loki-checkout-dev/-/packages/composer/packages.json
- name: Configure Magento Marketplace
if: env.SKIP_JOB != 'true'
run: |
test -n "${{ secrets.MAGENTO_MARKETPLACE_PUBLIC_KEY }}" || exit 0
composer config --global --auth http-basic.repo.magento.com "${{ secrets.MAGENTO_MARKETPLACE_PUBLIC_KEY }}" "${{ secrets.MAGENTO_MARKETPLACE_PRIVATE_KEY }}"
- name: Configure composer
if: env.SKIP_JOB != 'true'
run: |
cd /tmp/magento
composer config --global --auth github-oauth.github.com "${{ secrets.COMPOSER_GITHUB_TOKEN }}"
test -f $GITHUB_WORKSPACE/.github/workflows/composer-additional.sh && source $GITHUB_WORKSPACE/.github/workflows/composer-additional.sh || true
test -f $GITHUB_WORKSPACE/.github/workflows/composer-${MAGENTO_VERSION}.sh && source $GITHUB_WORKSPACE/.github/workflows/composer-${MAGENTO_VERSION}.sh || true
- name: Add module source
if: env.SKIP_JOB != 'true'
run: |
cp -R ${GITHUB_WORKSPACE} /tmp/magento/package-source
cd /tmp/magento
composer config repositories.local-source path package-source/
composer require -n --prefer-source ${COMPOSER_NAME}:@dev
- name: Run Magento 2 compilation
if: env.SKIP_JOB != 'true'
run: |
cd /tmp/magento
bin/magento module:enable --all
php -dzend.enable_gc=0 -drealpath_cache_size=64M -drealpath_cache_ttl=7200 -dopcache.enable_cli=1 -dopcache.memory_consumption=512 -dopcache.interned_strings_buffer=64 -dopcache.max_accelerated_files=100000 -dmemory_limit=-1 bin/magento setup:di:compile