-
Notifications
You must be signed in to change notification settings - Fork 45
/
.travis.yml
126 lines (119 loc) · 4.33 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
---
dist: trusty
language: node_js
node_js: 12.14.1
osx_image: xcode11
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-8
- g++-8
- jq
services:
- docker
cache:
yarn: true
directories:
- $HOME/.cache/electron
- $HOME/.cache/electron-builder
- $HOME/bin
os:
- linux
- osx
env:
global:
- COZY_DESKTOP_DIR=/tmp/cozy-desktop
- COZY_URL="http://localhost:8080"
- COZY_PASSPHRASE="cozy"
- COZY_STACK_STORAGE="$HOME/storage"
- GOPATH="$HOME"
- GOPROXY="https://proxy.golang.org"
- GO111MODULE=on
# FIXME: Homebrew 1.7.3 fails to install cask apache-couchdb
- HOMEBREW_NO_AUTO_UPDATE=1
- MOCHA_TIMEOUT="240000"
- NO_BREAKPOINTS=1
- NODE_ENV=test
- NPM_CONFIG_PROGRESS=false
- COZY_DESKTOP_HEARTBEAT=1000
matrix:
- JOB=unit COZY_DESKTOP_FS=APFS
- JOB=scenarios COZY_DESKTOP_FS=APFS
- JOB=scenarios COZY_DESKTOP_FS=HFS+
- JOB=stopped_scenarios COZY_DESKTOP_FS=APFS
- JOB=dist COZY_DESKTOP_FS=APFS
- JOB=unit CC=gcc-8 CXX=g++-8
- JOB=scenarios CC=gcc-8 CXX=g++-8
- JOB=stopped_scenarios CC=gcc-8 CXX=g++-8
- JOB=dist CC=gcc-8 CXX=g++-8
branches:
only:
- master
jobs:
fast_finish: true
exclude:
- if: os = linux
env: JOB=unit COZY_DESKTOP_FS=APFS
- if: os = linux
env: JOB=scenarios COZY_DESKTOP_FS=APFS
- if: os = linux
env: JOB=stopped_scenarios COZY_DESKTOP_FS=APFS
- if: os = linux
env: JOB=dist COZY_DESKTOP_FS=APFS
- if: os = linux
env: JOB=scenarios COZY_DESKTOP_FS=HFS+
- if: os = osx
env: JOB=unit CC=gcc-8 CXX=g++-8
- if: os = osx
env: JOB=scenarios CC=gcc-8 CXX=g++-8
- if: os = osx
env: JOB=stopped_scenarios CC=gcc-8 CXX=g++-8
- if: os = osx
env: JOB=dist CC=gcc-8 CXX=g++-8
script: travis_wait ./dev/ci/script.sh
before_install: | # install cozy stack for integration test
# CouchDB
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
travis_retry docker run -d -p 5984:5984 --name couch apache/couchdb:2.3.1;
fi
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
wget https://dl.bintray.com/apache/couchdb/mac/2.3.1/Apache-CouchDB-2.3.1.zip
unzip Apache-CouchDB-2.3.1.zip
mv "Apache CouchDB.app" /Applications/
#travis_retry brew cask install https://raw.githubusercontent.com/Homebrew/homebrew-cask/master/Casks/apache-couchdb.rb;
printf "\n[log]\nlevel = warn\n" >> /Applications/Apache\ CouchDB.app/Contents/Resources/couchdbx-core/etc/local.ini;
ulimit -S -n 1024;
(/Applications/Apache\ CouchDB.app/Contents/Resources/couchdbx-core/bin/couchdb >couchdb.log 2>&1 &);
fi
sleep 8
curl -X PUT http://127.0.0.1:5984/{_users,_replicator,_global_changes}
# Cozy-stack
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
travis_retry brew install gimme;
travis_retry brew install imagemagick;
fi
if [[ ! -f $GOPATH/bin/cozy-stack ]]; then
travis_retry gimme 1.14;
source ~/.gimme/envs/go1.14.env;
travis_retry go get github.com/cozy/cozy-stack;
fi
# Create a local instance and an OAuth client
mkdir -p "$COZY_STACK_STORAGE"
($GOPATH/bin/cozy-stack serve --fs-url "file://$COZY_STACK_STORAGE" --log-level warning >cozy-stack.log 2>&1 &);
sleep 1
travis_retry $GOPATH/bin/cozy-stack instances add --dev --passphrase "$COZY_PASSPHRASE" localhost:8080
export COZY_CLIENT_ID=$($GOPATH/bin/cozy-stack instances client-oauth localhost:8080 http://localhost/ test github.com/cozy-labs/cozy-desktop)
export COZY_STACK_TOKEN=$($GOPATH/bin/cozy-stack instances token-oauth localhost:8080 "$COZY_CLIENT_ID" io.cozy.files io.cozy.settings)
# COZY_DESKTOP_DIR
if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
hdiutil create -megabytes 50 -fs "$COZY_DESKTOP_FS" -volname cozy-desktop "$COZY_DESKTOP_DIR";
hdiutil attach "${COZY_DESKTOP_DIR}.dmg" -mountpoint "$COZY_DESKTOP_DIR";
else
mkdir -p "$COZY_DESKTOP_DIR";
fi
# Dummy .env.test (all variables are already set)
# env-cmd ignores the file when empty
echo "NODE_ENV=test" > "${TRAVIS_BUILD_DIR}/.env.test"
after_failure: ./dev/ci/after_failure.sh