summaryrefslogtreecommitdiffstats
path: root/.travis.yml
blob: 017662e1c5f84fe2a720fa1da3be27e5f96a8583 (plain)
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
sudo: false
dist: trusty
language: php
php:
    - 5.4
    - 7
env:
    global:
        - CORE_BRANCH=stable9
    matrix:
        - DB=pgsql

branches:
  only:
    - master
    - /^stable\d+(\.\d+)?$/
    - /^v\d++(\.\d+)?+(\.\d+)?+(\.\d+)?$/

matrix:
    allow_failures:
        - env: DB=pgsql CORE_BRANCH=master
    include:
        - php: 5.5
          env: DB=sqlite
        - php: 5.5
          env: DB=mysql
        - php: 5.6
          env:  DB=pgsql CORE_BRANCH=master
    fast_finish: true

before_install:
    - export DISPLAY=:99.0
    - sh -e /etc/init.d/xvfb start
    - nvm install 5.6
    - npm install -g npm@latest
    - make
    - make appstore
    # install core
    - cd ../
    - git clone https://github.com/owncloud/core.git --recursive --depth 1 -b $CORE_BRANCH owncloud
    - mv contacts owncloud/apps/

before_script:
    - if [[ "$DB" == 'pgsql' ]]; then createuser -U travis -s oc_autotest; fi
    - if [[ "$DB" == 'mysql' ]]; then mysql -u root -e 'create database oc_autotest;'; fi
    - if [[ "$DB" == 'mysql' ]]; then mysql -u root -e "CREATE USER 'oc_autotest'@'localhost' IDENTIFIED BY '';"; fi
    - if [[ "$DB" == 'mysql' ]]; then mysql -u root -e "grant all on oc_autotest.* to 'oc_autotest'@'localhost';"; fi
    # fill owncloud with default configs and enable contacts
    - cd owncloud
    - mkdir data
    - ./occ maintenance:install --database-name oc_autotest --database-user oc_autotest --admin-user admin --admin-pass admin --database $DB --database-pass=''
    - ./occ app:enable contacts
    - ./occ background:cron  # enable default cron
    - php -S localhost:8080 &
    - cd apps/contacts

script:
    - make test

after_failure:
    - cat ../../data/owncloud.log

after_success:
    # codecov has issues when not run exactly in the cloned folder on travis, so
    # revert everything
    - cd ../../../
    - mv owncloud/apps/contacts .
    - cd contacts
    - node_modules/codecov/bin/codecov

deploy:
    provider: releases
    api_key:
        secure: IBNQc4MsBqOc6bj2fD1PnMFfELFpP2GqpZjmBsqP43dWixo8vZzafg7JwlsfnuC0rfcOE/2NwHQl43d+37sXMbMl+ZXgz2ax/wOyLAS2PK/EQEDkzYOdI0E/8u2D7V7m9LlCQ8MOGSGmjYwFcDLzcmgU8AOWg4N85ktpOkaiVF1287Rr+wcRZ0o4/VTVvykYzfKDIBaACAX+EaXtpBtD0cTr1lFN4vKuUma2+iX+MyPVZcvIbCWv2bTzqXzfkT3NagZuFXcooXhvPGFoOb8AisxRSoVP48Vpt8ziG+7wDFlIrNe+fjNJxOEMDEP8cYljoUU6MaOxcm012s/CqHjWBuTI5MRAWlH4w9YJ/1BhFoSJOUb21401zp255puPZJ+Vq8i720F21xm7g7Vc/1NsEAwmTzLgaG8cnV98SonITVDuR4qIaMWpHwTMhap6sHMW7UfH4QnCKypo1mgITFdjM9ANYbcfF8GBfrK4MZtuw75AcLoytFia+KnAOO7OpC93eo6Czcqu6ILOBz1XNWZcFQJTrkLKkFslZLhSSrgPrTL4Py0zVmBurxdOmoZkDcxyKmk/1ggQmZKhh7OS1TGW/7tckscwMhukLwnQiXBCQJ7VWAJ/2eaolym1+fDbqJ4z8t9q2KEfZyqlYAL4VxPqQzxwO9O19ej1WtncvpFHlQw=
    file: build/artifacts/appstore/contacts.tar.gz
    skip_cleanup: true
    on:
        repo: owncloud/contacts
        tags: true
        php: 7

addons:
    firefox: "latest"