forked from PrestaShopCorp/ps_checkout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
executable file
·81 lines (72 loc) · 1.98 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
language: php
services: docker
php:
- 5.6
- 7.2
jobs:
include:
- stage: "JS"
language: node_js
node_js: 13
install:
- yarn --cwd _dev/ install
script:
- yarn --cwd _dev/ lint
env:
- PRESTASHOP_VERSION=latest
matrix:
include:
- php: 7.2
# Does not check 1.7.0.0 to 1.7.0.2, as these versions aren't used on production.
env: PRESTASHOP_VERSION=1.7.0.3
cache:
directories:
- $HOME/.composer/cache
install:
- composer install
script:
# PHP syntax check
- find . -type f -name '*.php' ! -path "./vendor/*" ! -path "./tests/*" -exec php -l -n {} \; | (! grep -v "No syntax errors detected")
# PHP cs fixer
- vendor/bin/php-cs-fixer fix --no-interaction --dry-run --diff
# PHP Unit
- vendor/bin/phpunit tests
# PHP Stan
- if [ ${TRAVIS_PHP_VERSION:0:2} == "7." ]; then
docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/prestashop:${PRESTASHOP_VERSION};
docker run --rm --volumes-from temp-ps -v $PWD:/web/module -e _PS_ROOT_DIR_=/var/www/html --workdir=/web/module phpstan/phpstan:0.11.19 analyse --configuration=/web/module/tests/phpstan/phpstan.neon;
fi
before_deploy:
# NodeJs installation & js compilation
- sudo rm -rf ~/.nvm
- curl -sL "https://deb.nodesource.com/setup_10.x" | sudo -E bash -
- sudo apt-get install -y nodejs
- yarn --cwd _dev/ install
- yarn --cwd _dev/ build
# Composer
- composer install --no-dev -o
# Cleanup
- rm -f .php_cs.*
- rm -f .travis.yml
- rm -f cloudbuild.yaml
- rm -f composer.*
- rm -f .gitignore
- rm -f deploy.sh
- rm -f .editorconfig
- rm -rf .git
- rm -rf _dev
- rm -rf tests
- rm -rf docker-compose.yml
- rm -rf Makefile
- pushd $TRAVIS_BUILD_DIR/..
- mkdir /tmp/build
- zip /tmp/build/$(ls | head -1).zip -r $(ls | head -1)/
- popd
deploy:
provider: releases
api_key: ${travis_api_key}
file: "/tmp/build/ps_checkout.zip"
skip_cleanup: true
on:
all_branches: true
tags: true