forked from Invertus/mollie1.7
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
105 lines (99 loc) · 3.08 KB
/
.travis.yml
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
language: php
dist: xenial
node_js:
- 10
sudo: true
services:
- docker
addons:
chrome: stable
env:
global:
- COMPOSER_NO_INTERACTION=1
- PRESTASHOP_PORT=8090
cache:
- yarn
- npm
- directories:
- "$HOME/.composer/cache"
- node_modules
matrix:
fast_finish: true
include:
- php: 5.3
dist: precise
env: TEST_SYNTAX=true SKIP_NODE=true
- php: 5.4
dist: precise
env: TEST_SYNTAX=true SKIP_NODE=true
- php: 5.5
dist: precise
env: TEST_SYNTAX=true SKIP_NODE=true
- php: 5.6
env: TEST_SYNTAX=true
- php: 7.0
env: TEST_SYNTAX=true
- php: 7.1
env: TEST_SYNTAX=true
- php: 7.2
env: TEST_SYNTAX=true
- php: 7.3
env: TEST_SYNTAX=true
- php: 7.1
env: TEST_UNIT=true
- php: 7.1
env: TEST_FRONTEND=true
# - php: 7.1
# env: PRESTASHOP_VERSION="1.5.4.2" TEST_ACCEPTANCE=true
# - php: 7.1
# env: PRESTASHOP_VERSION="1.5.6.2" TEST_ACCEPTANCE=true
# - php: 7.1
# env: PRESTASHOP_VERSION="1.6.0.5" TEST_ACCEPTANCE=true
# - php: 7.1
# env: PRESTASHOP_VERSION="1.6.1.23" TEST_ACCEPTANCE=true
# - php: 7.1
# env: PRESTASHOP_VERSION="1.7.3.4" TEST_ACCEPTANCE=true
# - php: 7.1
# env: PRESTASHOP_VERSION="1.7.4.4" TEST_ACCEPTANCE=true
- php: 7.1
env: PRESTASHOP_VERSION="1.7.5.0" TEST_ACCEPTANCE=true
before_install:
- >
if [[ "${SKIP_NODE}" != "true" ]]; then
curl -o- -L https://yarnpkg.com/install.sh | bash
export PATH="$HOME/.yarn/bin:$PATH"
fi
before_script:
# Build the release
- >
if [[ "${TEST_UNIT}" = "true" ]] || [[ "${TEST_ACCEPTANCE}" = "true" ]]; then
export MOLLIE_MODULE_VERSION=$(sed -ne "s/\\\$this->version *= *['\"]\([^'\"]*\)['\"] *;.*/\1/p" mollie.php | awk '{$1=$1};1')
make r
cp ./build/mollie-v${MOLLIE_MODULE_VERSION}.zip ./tests/_data/mollie.zip
fi
- >
if [[ "${TEST_ACCEPTANCE}" = "true" ]]; then
yarn global add chromedriver
fi
# Run docker + headless Chrome and wait until PrestaShop is installed
- >
if [[ ${PRESTASHOP_VERSION} ]]; then
git clone https://github.com/PrestaShop/PrestaShop --depth 1 --branch ${PRESTASHOP_VERSION} prestashop
docker-compose up -d
nohup chromedriver --url-base=/wd/hub &
until $(curl --output /dev/null --silent --head --fail http://localhost:${PRESTASHOP_PORT}); do
printf 'Installing PrestaShop...'
sleep 5
done
printf 'PrestaShop seems to be up and running'
sudo rm ./prestashop/modules/welcome -rf
fi
script:
# Syntax checker
- if [[ "${TEST_SYNTAX}" = "true" ]]; then find controllers sql translations upgrade views countries.php mollie.php -name '*.php' | xargs -n 1 -P4 php -l; fi
# Unit tests (Codeception)
- if [[ "${TEST_UNIT}" = "true" ]]; then php codecept.phar run unit; fi
# Acceptance tests (Codeception)
- if [[ "{$TEST_ACCEPTANCE}" = "true" ]] && [[ "${TRAVIS_PULL_REQUEST}" = "false" ]]; then php codecept.phar run acceptance; fi
# Frontend tests (Jest)
- if [[ "${TEST_FRONTEND}" = "true" ]]; then cd views/js/src/ && yarn test; fi