diff --git a/.travis.yml b/.travis.yml
index db239f2..6296842 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,34 +1,26 @@
-language: php
-
+os: linux
dist: trusty
-sudo: false
+language: php
-php:
- - 5.6
- - 7.0
- - 7.1
+if: tag IS blank
-env:
- - WP_VERSION=latest WP_MULTISITE=0
-
-matrix:
- fast_finish: true
- include:
- - php: 7.2
- env: WP_VERSION=latest WP_MULTISITE=0 RUN_PHPCS=1
+stages:
+ - test
+ - deploy
before_script:
- bash tests/bin/install.sh wc_retailcrm_test root '' localhost $WP_VERSION
-script:
- - bash tests/bin/script.sh
+script: make tests
-deploy:
- skip_cleanup: true
- provider: script
- script: make
- on:
- php: 7.2
- branch: master
- condition: "$DEPLOY = true"
+jobs:
+ include:
+ - php: 5.6
+ env: WP_VERSION=latest WP_MULTISITE=0
+ - stage: deploy
+ deploy:
+ cleanup: false
+ provider: script
+ script: make
+ if: branch = master AND type = push AND fork = false
\ No newline at end of file
diff --git a/Makefile b/Makefile
index 59a6dd0..b0e6d02 100644
--- a/Makefile
+++ b/Makefile
@@ -20,3 +20,18 @@ svn_push: /tmp/svn_plugin_dir
remove_dir:
rm -rf /tmp/svn_plugin_dir
+
+compile_pot:
+ msgfmt resources/pot/retailcrm-ru_RU.pot -o src/languages/retailcrm-ru_RU.mo
+ msgfmt resources/pot/retailcrm-es_ES.pot -o src/languages/retailcrm-es_ES.mo
+
+install:
+ bash tests/bin/install.sh
+ composer install
+
+tests: install
+ifeq ($(USE_COMPOSER),1)
+ vendor/phpunit/phpunit/phpunit -c phpunit.xml.dist
+else
+ phpunit -c phpunit.xml.dist
+endif
\ No newline at end of file
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index 8057fd7..44f2477 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -13,7 +13,7 @@
>
- tests/phpunit
+ tests
diff --git a/resources/bin/pot_compile.sh b/resources/bin/pot_compile.sh
deleted file mode 100755
index db6e82f..0000000
--- a/resources/bin/pot_compile.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-DIRECTORY=$(cd `dirname $0` && pwd)
-
-msgfmt $DIRECTORY/../pot/retailcrm-ru_RU.pot -o $DIRECTORY/../../src/languages/retailcrm-ru_RU.mo
-msgfmt $DIRECTORY/../pot/retailcrm-es_ES.pot -o $DIRECTORY/../../src/languages/retailcrm-es_ES.mo
\ No newline at end of file
diff --git a/tests/bin/script.sh b/tests/bin/script.sh
deleted file mode 100644
index f92901b..0000000
--- a/tests/bin/script.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env bash
-
-if [[ ${RUN_PHPCS} == 1 ]]; then
- composer install
- vendor/phpunit/phpunit/phpunit -c phpunit.xml.dist
-else
- phpunit -c phpunit.xml.dist
-fi
diff --git a/tests/phpunit/bootstrap.php b/tests/bootstrap.php
similarity index 100%
rename from tests/phpunit/bootstrap.php
rename to tests/bootstrap.php
diff --git a/tests/phpunit/customer/test-wc-retailcrm-customer-address.php b/tests/customer/test-wc-retailcrm-customer-address.php
similarity index 100%
rename from tests/phpunit/customer/test-wc-retailcrm-customer-address.php
rename to tests/customer/test-wc-retailcrm-customer-address.php
diff --git a/tests/phpunit/order/test-wc-retailcrm-order-address.php b/tests/order/test-wc-retailcrm-order-address.php
similarity index 100%
rename from tests/phpunit/order/test-wc-retailcrm-order-address.php
rename to tests/order/test-wc-retailcrm-order-address.php
diff --git a/tests/phpunit/order/test-wc-retailcrm-order-item.php b/tests/order/test-wc-retailcrm-order-item.php
similarity index 100%
rename from tests/phpunit/order/test-wc-retailcrm-order-item.php
rename to tests/order/test-wc-retailcrm-order-item.php
diff --git a/tests/phpunit/order/test-wc-retailcrm-order-payment.php b/tests/order/test-wc-retailcrm-order-payment.php
similarity index 100%
rename from tests/phpunit/order/test-wc-retailcrm-order-payment.php
rename to tests/order/test-wc-retailcrm-order-payment.php
diff --git a/tests/phpunit/test-wc-retailcrm-base.php b/tests/test-wc-retailcrm-base.php
similarity index 100%
rename from tests/phpunit/test-wc-retailcrm-base.php
rename to tests/test-wc-retailcrm-base.php
diff --git a/tests/phpunit/test-wc-retailcrm-customers.php b/tests/test-wc-retailcrm-customers.php
similarity index 100%
rename from tests/phpunit/test-wc-retailcrm-customers.php
rename to tests/test-wc-retailcrm-customers.php
diff --git a/tests/phpunit/test-wc-retailcrm-daemon-collector.php b/tests/test-wc-retailcrm-daemon-collector.php
similarity index 100%
rename from tests/phpunit/test-wc-retailcrm-daemon-collector.php
rename to tests/test-wc-retailcrm-daemon-collector.php
diff --git a/tests/phpunit/test-wc-retailcrm-ga.php b/tests/test-wc-retailcrm-ga.php
similarity index 100%
rename from tests/phpunit/test-wc-retailcrm-ga.php
rename to tests/test-wc-retailcrm-ga.php
diff --git a/tests/phpunit/test-wc-retailcrm-history.php b/tests/test-wc-retailcrm-history.php
similarity index 100%
rename from tests/phpunit/test-wc-retailcrm-history.php
rename to tests/test-wc-retailcrm-history.php
diff --git a/tests/phpunit/test-wc-retailcrm-inventories.php b/tests/test-wc-retailcrm-inventories.php
similarity index 100%
rename from tests/phpunit/test-wc-retailcrm-inventories.php
rename to tests/test-wc-retailcrm-inventories.php
diff --git a/tests/phpunit/test-wc-retailcrm-orders.php b/tests/test-wc-retailcrm-orders.php
similarity index 100%
rename from tests/phpunit/test-wc-retailcrm-orders.php
rename to tests/test-wc-retailcrm-orders.php
diff --git a/tests/phpunit/test-wc-retailcrm-plugin.php b/tests/test-wc-retailcrm-plugin.php
similarity index 100%
rename from tests/phpunit/test-wc-retailcrm-plugin.php
rename to tests/test-wc-retailcrm-plugin.php