-
Notifications
You must be signed in to change notification settings - Fork 7
59 lines (51 loc) · 2.54 KB
/
compile.yml
File metadata and controls
59 lines (51 loc) · 2.54 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
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.5-p14', '2.4.7-p4', '2.4.7-p7', '2.4.8', '2.4.8-p1', '2.4.8-p2', '2.4.8-p3']
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
- 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: 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 Yireo GitLab
if: env.SKIP_JOB != 'true'
run: |
test -n "${{ secrets.GITLAB_TOKEN }}" || exit 0
cd /tmp/magento
ls ${GITHUB_WORKSPACE}
test -f ${GITHUB_WORKSPACE}/.github/workflows/composer-additional.sh && source ${GITHUB_WORKSPACE}/.github/workflows/composer-additional.sh
test -f ${GITHUB_WORKSPACE}/.github/workflows/composer-${{ matrix.magento_version }}.sh && source ${GITHUB_WORKSPACE}/.github/workflows/composer-${{ matrix.magento_version }}.sh
composer config gitlab-domains gitlab.yireo.com
composer config --global --auth http-basic.gitlab.yireo.com yireo "${{ 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
- 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 --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 -dmemory_limit=-1 bin/magento setup:di:compile