Skip to content

Commit 15023e3

Browse files
committed
Add ps8 CI
1 parent dbd4e4c commit 15023e3

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

.github/workflows/ci-ps8.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI for PS8 build
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '**'
7+
push:
8+
branches:
9+
- 'main'
10+
11+
jobs:
12+
lint:
13+
name: PHP CS fixer
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v3
19+
20+
- name: Setup PHP
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: 7.4
24+
25+
- name: Install Composer
26+
run: |
27+
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
28+
php composer-setup.php
29+
php -r "unlink('composer-setup.php');"
30+
sudo mv composer.phar /usr/local/bin/composer
31+
32+
- name: Prepare workflow
33+
run: |
34+
cp -r .env.dist .env || true
35+
36+
- name: Build docker image for ps8
37+
run: make build-ci module_version=ps8
38+
39+
- name: Run PHP CS Fixer for ps8
40+
run: make php-cs-fixer-ci module_version=ps8

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,22 @@ build:
1414
MODULE_VERSION=$(module_version) docker compose build --no-cache
1515
# make build module_version=ps8
1616

17+
build-ci:
18+
composer install
19+
cd $${MODULE_VERSION} && composer install
20+
MODULE_VERSION=$(module_version) SSL_ENABLED=$(ssl_enabled) docker compose up -d --build
21+
# make build module_version=ps8
22+
1723
down:
1824
docker compose down --remove-orphans
1925

2026
php-cs-fixer:
2127
docker exec -i $${MODULE_VERSION}-ps-prestashop-$${PS_VERSION_TAG} /bin/bash -c "cd modules/ps_checkout && php vendor/bin/php-cs-fixer fix"
2228
# make php-cs-fixer module_version=ps8
2329

30+
php-cs-fixer-ci:
31+
docker exec -i ${MODULE_VERSION}-ps-prestashop-${PS_VERSION_TAG} /bin/bash -c "cd modules/ps_checkout && php vendor/bin/php-cs-fixer fix --dry-run --diff --verbose; exit \$\$?"
32+
2433
autoindex:
2534
docker exec -i $${MODULE_VERSION}-ps-prestashop-$${PS_VERSION_TAG} /bin/bash -c "cd modules/ps_checkout && php vendor/bin/autoindex prestashop:add:index /var/www/html/modules/ps_checkout && php vendor/bin/autoindex prestashop:add:index /var/www/html/modules/ps_checkout/vendor"
2635
# make autoindex module_version=ps8

0 commit comments

Comments
 (0)