mirror of
https://github.com/retailcrm/prestashop-module.git
synced 2025-03-01 19:03:14 +03:00
Move to GitHub actions
This commit is contained in:
parent
66e678f50c
commit
438cd8d077
179
.github/workflows/presta.yml
vendored
Normal file
179
.github/workflows/presta.yml
vendored
Normal file
@ -0,0 +1,179 @@
|
||||
name: presta
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
tags-ignore:
|
||||
- '*.*'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- php-version: '5.6'
|
||||
branch: '1.6.1.18'
|
||||
phpunit-version: 'phpunit:5.7.23'
|
||||
coverage: 1
|
||||
- php-version: '7.0'
|
||||
branch: '1.6.1.18'
|
||||
phpunit-version: 'phpunit:6.4.3'
|
||||
- php-version: '7.1'
|
||||
branch: '1.6.1.18'
|
||||
phpunit-version: 'phpunit:6.4.3'
|
||||
|
||||
- php-version: '5.6'
|
||||
branch: '1.6.1.19'
|
||||
phpunit-version: 'phpunit:5.7.23'
|
||||
- php-version: '7.0'
|
||||
branch: '1.6.1.19'
|
||||
phpunit-version: 'phpunit:6.4.3'
|
||||
- php-version: '7.1'
|
||||
branch: '1.6.1.19'
|
||||
phpunit-version: 'phpunit:6.4.3'
|
||||
|
||||
- php-version: '5.6'
|
||||
branch: '1.6.1.20'
|
||||
phpunit-version: 'phpunit:5.7.23'
|
||||
- php-version: '7.0'
|
||||
branch: '1.6.1.20'
|
||||
phpunit-version: 'phpunit:6.4.3'
|
||||
- php-version: '7.1'
|
||||
branch: '1.6.1.20'
|
||||
phpunit-version: 'phpunit:6.4.3'
|
||||
|
||||
- php-version: '5.6'
|
||||
branch: '1.6.1.21'
|
||||
phpunit-version: 'phpunit:5.7.23'
|
||||
- php-version: '7.0'
|
||||
branch: '1.6.1.21'
|
||||
phpunit-version: 'phpunit:6.4.3'
|
||||
- php-version: '7.1'
|
||||
branch: '1.6.1.21'
|
||||
phpunit-version: 'phpunit:6.4.3'
|
||||
|
||||
- php-version: '5.6'
|
||||
branch: '1.6.1.22'
|
||||
phpunit-version: 'phpunit:5.7.23'
|
||||
- php-version: '7.0'
|
||||
branch: '1.6.1.22'
|
||||
phpunit-version: 'phpunit:6.4.3'
|
||||
- php-version: '7.1'
|
||||
branch: '1.6.1.22'
|
||||
phpunit-version: 'phpunit:6.4.3'
|
||||
|
||||
- php-version: '5.6'
|
||||
branch: '1.6.1.23'
|
||||
phpunit-version: 'phpunit:5.7.23'
|
||||
- php-version: '7.0'
|
||||
branch: '1.6.1.23'
|
||||
phpunit-version: 'phpunit:6.4.3'
|
||||
- php-version: '7.1'
|
||||
branch: '1.6.1.23'
|
||||
phpunit-version: 'phpunit:6.4.3'
|
||||
|
||||
- php-version: '5.6'
|
||||
branch: '1.6.1.24'
|
||||
phpunit-version: 'phpunit:5.7.23'
|
||||
- php-version: '7.0'
|
||||
branch: '1.6.1.24'
|
||||
phpunit-version: 'phpunit:6.4.3'
|
||||
- php-version: '7.1'
|
||||
branch: '1.6.1.24'
|
||||
phpunit-version: 'phpunit:6.4.3'
|
||||
|
||||
- php-version: '7.1'
|
||||
branch: '1.7.4.0'
|
||||
composerv1: 1
|
||||
phpunit-version: 'phpunit:6.4.3'
|
||||
- php-version: '7.2'
|
||||
branch: '1.7.4.0'
|
||||
composerv1: 1
|
||||
phpunit-version: 'phpunit:6.4.3'
|
||||
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:5.7
|
||||
env:
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
ports:
|
||||
- 3306/tcp
|
||||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup PHP ${{ matrix.php-version }}
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-version }}
|
||||
coverage: xdebug
|
||||
tools: composer:v2, ${{ matrix.phpunit-version }}
|
||||
extensions: gd, mbstring, zip, mcrypt, pdo_mysql, dom
|
||||
- name: Start mysql service
|
||||
run: sudo /etc/init.d/mysql start
|
||||
- name: Status mysql service
|
||||
run: sudo systemctl status mysql
|
||||
- name: Install PrestaShop
|
||||
env:
|
||||
BRANCH: ${{ matrix.branch }}
|
||||
COMPOSERV1: ${{ matrix.composerv1 }}
|
||||
run: make before_script
|
||||
- name: Run tests
|
||||
env:
|
||||
BRANCH: ${{ matrix.branch }}
|
||||
COMPOSERV1: ${{ matrix.composerv1 }}
|
||||
run: make test
|
||||
- name: Coverage
|
||||
env:
|
||||
COVERAGE: ${{ matrix.coverage }}
|
||||
if: env.COVERAGE == 1
|
||||
run: |
|
||||
make coverage
|
||||
bash <(curl -s https://codecov.io/bash)
|
||||
|
||||
|
||||
deploy:
|
||||
needs: ['test']
|
||||
if: success() && github.event_name == 'push' && github.repository_owner == 'retailcrm' && github.ref == 'refs/heads/master'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup PHP 7.2
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '7.2'
|
||||
tools: composer:v1
|
||||
- name: Build release
|
||||
run: |
|
||||
git fetch origin --unshallow --tags
|
||||
export LAST_TAG=`git describe --abbrev=0 --tags`
|
||||
export VERSION=`cat VERSION`
|
||||
export ARCHIVE_NAME=retailcrm-$VERSION.ocmod.zip
|
||||
export ARCHIVE_PATH="/tmp/$ARCHIVE_NAME"
|
||||
export RELEASE_TAG=v$VERSION
|
||||
export LAST_COMMIT=`git log --oneline --format=%B -n 1 HEAD | head -n 1`
|
||||
echo RELEASE_TAG=$RELEASE_TAG >> $GITHUB_ENV
|
||||
echo LAST_TAG=$LAST_TAG >> $GITHUB_ENV
|
||||
echo LAST_COMMIT=$LAST_COMMIT >> $GITHUB_ENV
|
||||
echo ARCHIVE_PATH=$ARCHIVE_PATH >> $GITHUB_ENV
|
||||
echo ARCHIVE_NAME=$ARCHIVE_NAME >> $GITHUB_ENV
|
||||
make build_archive
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
if: env.LAST_TAG != env.RELEASE_TAG
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ env.RELEASE_TAG }}
|
||||
release_name: ${{ env.RELEASE_TAG }}
|
||||
body: ${{ env.LAST_COMMIT }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
- name: Deploy
|
||||
run: make build_archive
|
||||
- name: Cleanup
|
||||
if: env.LAST_TAG != env.RELEASE_TAG
|
||||
run: make delete_archive
|
106
.travis.yml
106
.travis.yml
@ -1,106 +0,0 @@
|
||||
os: linux
|
||||
dist: trusty
|
||||
|
||||
language: php
|
||||
|
||||
if: tag IS blank
|
||||
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- apache2
|
||||
- libapache2-mod-fastcgi
|
||||
|
||||
before_install:
|
||||
- export LAST_TAG=`git describe --abbrev=0 --tags`
|
||||
- export CURRENT_VERSION=v`cat VERSION`
|
||||
|
||||
before_script: make before_script
|
||||
|
||||
script: make test
|
||||
|
||||
stages:
|
||||
- test
|
||||
- deploy
|
||||
|
||||
jobs:
|
||||
include:
|
||||
- php: 5.6
|
||||
env: BRANCH=1.6.1.18 COMPOSER_IN_TESTS=1
|
||||
- php: 7.0
|
||||
env: BRANCH=1.6.1.18 COMPOSER_IN_TESTS=1
|
||||
- php: 7.1
|
||||
env: BRANCH=1.6.1.18 COMPOSER_IN_TESTS=1
|
||||
|
||||
- php: 5.6
|
||||
env: BRANCH=1.6.1.19 COMPOSER_IN_TESTS=1
|
||||
- php: 7.0
|
||||
env: BRANCH=1.6.1.19 COMPOSER_IN_TESTS=1
|
||||
- php: 7.1
|
||||
env: BRANCH=1.6.1.19 COMPOSER_IN_TESTS=1
|
||||
|
||||
- php: 5.6
|
||||
env: BRANCH=1.6.1.20 COMPOSER_IN_TESTS=1
|
||||
- php: 7.0
|
||||
env: BRANCH=1.6.1.20 COMPOSER_IN_TESTS=1
|
||||
- php: 7.1
|
||||
env: BRANCH=1.6.1.20 COMPOSER_IN_TESTS=1
|
||||
|
||||
- php: 5.6
|
||||
env: BRANCH=1.6.1.21 COMPOSER_IN_TESTS=1
|
||||
- php: 7.0
|
||||
env: BRANCH=1.6.1.21 COMPOSER_IN_TESTS=1
|
||||
- php: 7.1
|
||||
env: BRANCH=1.6.1.21 COMPOSER_IN_TESTS=1
|
||||
|
||||
- php: 5.6
|
||||
env: BRANCH=1.6.1.22 COMPOSER_IN_TESTS=1
|
||||
- php: 7.0
|
||||
env: BRANCH=1.6.1.22 COMPOSER_IN_TESTS=1
|
||||
- php: 7.1
|
||||
env: BRANCH=1.6.1.22 COMPOSER_IN_TESTS=1
|
||||
|
||||
- php: 5.6
|
||||
env: BRANCH=1.6.1.23 COMPOSER_IN_TESTS=1
|
||||
- php: 7.0
|
||||
env: BRANCH=1.6.1.23 COMPOSER_IN_TESTS=1
|
||||
- php: 7.1
|
||||
env: BRANCH=1.6.1.23 COMPOSER_IN_TESTS=1
|
||||
|
||||
- php: 5.6
|
||||
env: BRANCH=1.6.1.24 COMPOSER_IN_TESTS=1
|
||||
- php: 7.0
|
||||
env: BRANCH=1.6.1.24 COMPOSER_IN_TESTS=1
|
||||
- php: 7.1
|
||||
env: BRANCH=1.6.1.24 COMPOSER_IN_TESTS=1
|
||||
|
||||
- php: 7.1
|
||||
env: BRANCH=1.7.4.0
|
||||
- php: 7.2
|
||||
env: BRANCH=1.7.4.0
|
||||
|
||||
- php: 7.1
|
||||
env: BRANCH=1.7.5.x
|
||||
- php: 7.2
|
||||
env: BRANCH=1.7.5.x
|
||||
after_success: bash <(curl -s https://codecov.io/bash)
|
||||
|
||||
- stage: deploy
|
||||
before_script: skip
|
||||
script: make build_archive
|
||||
before_deploy:
|
||||
- export VERSION=`cat VERSION`
|
||||
- export ARCHIVE_NAME=/tmp/retailcrm-$VERSION.zip
|
||||
- git config --local user.name "RetailCRM"
|
||||
- git config --local user.email "support@retailcrm.ru"
|
||||
- export TRAVIS_TAG=v$VERSION
|
||||
- git tag $TRAVIS_TAG
|
||||
deploy:
|
||||
provider: releases
|
||||
token: $GITHUB_OAUTH_TOKEN
|
||||
cleanup: false
|
||||
file: $ARCHIVE_NAME
|
||||
on:
|
||||
condition: "$LAST_TAG != $CURRENT_VERSION"
|
||||
if: branch = master AND type = push AND fork = false
|
||||
after_deploy: make delete_archive
|
@ -1,3 +1,6 @@
|
||||
## v3.2.2
|
||||
* GitHub actions
|
||||
|
||||
## v3.2.1
|
||||
* Ребрендинг RetailCRM
|
||||
|
||||
|
33
Makefile
33
Makefile
@ -1,6 +1,6 @@
|
||||
ROOT_DIR=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||
PRESTASHOP_DIR=$(ROOT_DIR)/../PrestaShop
|
||||
FILE = $(TRAVIS_BUILD_DIR)/VERSION
|
||||
FILE = $(ROOT_DIR)/VERSION
|
||||
VERSION = `cat $(FILE)`
|
||||
ARCHIVE_NAME = '/tmp/retailcrm-'$(VERSION)'.zip'
|
||||
|
||||
@ -15,11 +15,11 @@ delete_archive:
|
||||
rm -f /tmp/retailcrm.zip
|
||||
|
||||
composer: clone_prestashop
|
||||
@cd $(PRESTASHOP_DIR) && git checkout $(BRANCH)
|
||||
ifeq ($(COMPOSER_IN_TESTS),1)
|
||||
@cd $(PRESTASHOP_DIR)/tests && composer install
|
||||
cd $(PRESTASHOP_DIR) && git checkout $(BRANCH)
|
||||
ifeq ($(COMPOSERV1),1)
|
||||
cd $(PRESTASHOP_DIR) && php -r "copy('https://getcomposer.org/download/1.10.17/composer.phar', 'composer.phar');" && php composer.phar install --prefer-dist --no-interaction --no-progress
|
||||
else
|
||||
@cd $(PRESTASHOP_DIR) && php -r "copy('https://getcomposer.org/download/1.10.17/composer.phar', 'composer.phar');" && php composer.phar install --prefer-dist --no-interaction --no-progress
|
||||
cd $(PRESTASHOP_DIR)/tests && composer install
|
||||
endif
|
||||
|
||||
clone_prestashop:
|
||||
@ -37,21 +37,20 @@ setup_apache:
|
||||
sudo service apache2 restart
|
||||
|
||||
before_script: composer
|
||||
ifneq ($(COMPOSER_IN_TESTS),1)
|
||||
ifeq ("$(wildcard $(PRESTASHOP_DIR)/tests/parameters.yml.travis)","")
|
||||
cd $(PRESTASHOP_DIR) && cp tests/parameters.yml.travis app/config/parameters.yml
|
||||
else
|
||||
cd $(PRESTASHOP_DIR) && cp tests-legacy/parameters.yml.travis app/config/parameters.yml
|
||||
endif
|
||||
cd $(PRESTASHOP_DIR) && bash travis-scripts/install-prestashop
|
||||
mkdir coverage
|
||||
ifeq ($(COMPOSERV1),1)
|
||||
cd $(PRESTASHOP_DIR) && sed -i 's/--db_name=prestashop/--db_name=prestashop --db_user=root --db_password=root/g' travis-scripts/install-prestashop && bash travis-scripts/install-prestashop
|
||||
else
|
||||
cd $(PRESTASHOP_DIR) && bash travis-scripts/install-prestashop.sh
|
||||
cd $(PRESTASHOP_DIR) && sed -i 's/--db_name=prestashop/--db_name=prestashop --db_user=root --db_password=root/g' travis-scripts/install-prestashop.sh && bash travis-scripts/install-prestashop.sh
|
||||
endif
|
||||
|
||||
test:
|
||||
ifeq ($(COMPOSER_IN_TESTS),1)
|
||||
phpunit -c phpunit.xml.dist
|
||||
else
|
||||
ifeq ($(COMPOSERV1),1)
|
||||
cd $(PRESTASHOP_DIR) && php composer.phar run-script create-test-db --timeout=0
|
||||
cd $(PRESTASHOP_DIR) && php vendor/bin/phpunit -c $(ROOT_DIR)/phpunit.xml.dist
|
||||
endif
|
||||
else
|
||||
phpunit -c phpunit.xml.dist
|
||||
endif
|
||||
|
||||
coverage:
|
||||
wget https://phar.phpunit.de/phpcov-2.0.2.phar && php phpcov-2.0.2.phar merge coverage/ --clover coverage.xml
|
@ -1,7 +1,7 @@
|
||||
[](https://travis-ci.org/retailcrm/prestashop-module)
|
||||
[](https://codecov.io/gh/retailcrm/prestashop-module)
|
||||
[](https://github.com/retailcrm/prestashop-module/releases)
|
||||
[](https://php.net/)
|
||||
[](https://github.com/retailcrm/prestashop-module/actions)
|
||||
[](https://codecov.io/gh/retailcrm/prestashop-module)
|
||||
[](https://github.com/retailcrm/prestashop-module/releases)
|
||||
[](https://php.net/)
|
||||
|
||||
Prestashop module
|
||||
=================
|
||||
|
@ -117,7 +117,7 @@ class RetailCRM extends Module
|
||||
{
|
||||
$this->name = 'retailcrm';
|
||||
$this->tab = 'export';
|
||||
$this->version = '3.2.1';
|
||||
$this->version = '3.2.2';
|
||||
$this->author = 'DIGITAL RETAIL TECHNOLOGIES SL';
|
||||
$this->displayName = $this->l('retailCRM');
|
||||
$this->description = $this->l('Integration module for retailCRM');
|
||||
|
Loading…
x
Reference in New Issue
Block a user