Skip to content

Commit 8dd9b93

Browse files
committed
Add new GitHub Action workflows
1 parent df95c16 commit 8dd9b93

2 files changed

Lines changed: 57 additions & 1 deletion

File tree

.github/workflows/compile.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Magento 2 DI compilation
2+
on: ['push', 'pull_request']
3+
4+
jobs:
5+
compile:
6+
name: Magento 2 DI compilation
7+
#runs-on: self-hosted
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
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']
12+
container:
13+
image: yireo/magento2installed:${{ matrix.magento_version }}
14+
steps:
15+
- name: Checkout sources
16+
uses: actions/checkout@v4
17+
18+
- name: Configure Yireo GitLab
19+
run: |
20+
test -n "${{ secrets.GITLAB_TOKEN }}" || exit 0
21+
cd /tmp/magento
22+
composer config gitlab-domains gitlab.yireo.com
23+
composer config --global --auth http-basic.gitlab.yireo.com yireo "${{ secrets.GITLAB_TOKEN }}"
24+
composer config repositories.loki-third-party composer https://gitlab.yireo.com/api/v4/group/loki-third-party/-/packages/composer/packages.json
25+
composer config repositories.loki-checkout composer https://gitlab.yireo.com/api/v4/group/loki-checkout/-/packages/composer/packages.json
26+
27+
- name: Add module source
28+
run: |
29+
COMPOSER_NAME=$(grep '^COMPOSER_NAME=' .module.ini | cut -d= -f2- | tr -d '"')
30+
cp -R ${GITHUB_WORKSPACE} /tmp/magento/package-source
31+
cd /tmp/magento
32+
composer config repositories.local-source path package-source/
33+
composer require --prefer-source ${COMPOSER_NAME}:@dev
34+
35+
- name: Run Magento 2 compilation
36+
run: |
37+
cd /tmp/magento
38+
bin/magento module:enable --all
39+
php -dmemory_limit=-1 bin/magento setup:di:compile
40+

.github/workflows/static-tests.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,25 @@ name: Magento 2 Static Tests
22
on: ['push', 'pull_request']
33

44
jobs:
5+
phpcs:
6+
name: Magento PHPCS
7+
runs-on: ubuntu-latest
8+
container:
9+
image: yireo/magento2installed:2.4.8-p3
10+
steps:
11+
- name: Checkout sources
12+
uses: actions/checkout@v4
13+
14+
- name: Run Magento 2 PHPCS Tests
15+
run: |
16+
export PHPCS_LEVEL=$(jq -r '.phpcs_severity // 10' MODULE.json)
17+
test -z "$PHPCS_LEVEL" && PHPCS_LEVEL=10
18+
echo "Testing for PHPCS severity $PHPCS_LEVEL"
19+
cd /tmp/magento
20+
php vendor/bin/phpcs --standard=Magento2 --ignore=Test/,node_modules/ --colors --extensions=php,phtml --severity=$PHPCS_LEVEL ${GITHUB_WORKSPACE}
21+
522
phpstan:
623
name: Magento PHPStan
7-
#runs-on: self-hosted
824
runs-on: ubuntu-latest
925
container:
1026
image: yireo/magento2installed:2.4.8-p3

0 commit comments

Comments
 (0)