-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
49 lines (41 loc) · 1.38 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
sudo: false
language: php
matrix:
include:
## TODO: this works locally, but for some reason not in Travis
# - php: 7.0
# env: deps=low
- php: 7.1
env:
- cover=yes
- docs=yes
env:
global:
- deps=no
- cover=no
- docs=no
install:
- echo "{\"http-basic\":{\"repo.magento.com\":{\"username\":\"${MAGENTO_USERNAME}\",\"password\":\"${MAGENTO_PASSWORD}\"}}}" > auth.json
- if [ "$deps" = "no" ]; then composer $flag install; fi;
- if [ "$deps" = "low" ]; then composer $flag --prefer-lowest --prefer-stable update; fi;
# Build docs for Github Pages
- if [ "$docs" = "yes" ]; then ./vendor/bin/bookdown docs/bookdown.json --root-href=/magento2-module/; fi;
script:
- mkdir -p build/logs
- if [ "$cover" = "no" ]; then ./vendor/bin/phpunit; fi;
- if [ "$cover" = "yes" ]; then ./vendor/bin/phpunit --coverage-clover build/logs/coverage.xml; fi;
before_install:
- composer self-update
- composer config --quiet github-oauth.github.com $GITHUB_TOKEN
- if [[ ! $GITHUB_TOKEN ]]; then echo "no github token"; fi
- if [[ ! $GITHUB_TOKEN ]]; then flag=--prefer-source; fi
after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover build/logs/coverage.xml
deploy:
provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN
local_dir: ./build/docs
on:
branch: master