forked from node-hid/node-hid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
123 lines (105 loc) · 2.9 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
---
language: cpp
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
- g++-4.8-multilib
- gcc-multilib
- libgtk2.0-0
- libxtst6
- libnotify4
- libgconf2-4
- libgtk2.0-0:i386
- libxtst6:i386
- libnotify4:i386
- libgconf2-4:i386
- libnss3:i386
- libasound2:i386
- libxss1:i386
- socat
- libusb-1.0-0-dev
- libudev-dev
# Build matrix
os:
- linux
- osx
env:
global:
secure: "ULgQHud6rffcRBZrDk/a1jVnAfUm6CseQJ8j89S7As7gc/bQkD9fi0OAyr5qT5ymxtn4ujXACDEeFDF/BlGwsbFoOS4sApcP33sJ5rsGVgTqihA8Dzb6k2F5e0Cd80+VzPa+lDdtMuRQMaVctA9rWe7VcfJWUc7rei4/kYfAAL0="
matrix:
- TRAVIS_NODE_VERSION="4"
- TRAVIS_NODE_VERSION="6"
- BINARY_BUILDER="true" TRAVIS_NODE_VERSION="8"
# - BINARY_BUILDER="true" TRAVIS_NODE_VERSION="8" ARCH="x86"
# disable x86 for now because of weird errors with gyp under prebuild
matrix:
exclude:
- os: osx
env: TRAVIS_NODE_VERSION="4" ARCH="x86"
- os: osx
env: TRAVIS_NODE_VERSION="6" ARCH="x86"
- os: osx
env: BINARY_BUILDER="true" TRAVIS_NODE_VERSION="8" ARCH="x86"
before_install:
# download node if testing x86 architecture
- >
if [[ "$ARCH" == "x86" ]]; then
BASE_URL=$(node -p "'https://nodejs.org/dist/' + process.version");
X86_FILE=$(node -p "'node-' + process.version + '-' + process.platform + '-x86'");
wget $BASE_URL/$X86_FILE.tar.gz;
tar -xf $X86_FILE.tar.gz;
nvm deactivate;
export PATH=$X86_FILE/bin:$PATH;
else
nvm install $TRAVIS_NODE_VERSION
fi;
#- >
# if [[ $TRAVIS_OS_NAME == "linux" && "$ARCH" == "x86" ]]; then
# dpkg-query -L libusb-1.0-0-dev:i386
# dpkg-query -L libusb-1.0-0
# fi;
# use g++-4.8 on Linux
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then export CXX=g++-4.8; fi
- $CXX --version
# upgrade npm if on node 4 as npm2 doesn't like our dev peer deps
- if [[ $TRAVIS_NODE_VERSION == "4" ]]; then npm install -g npm; fi
# Cleanup the output of npm
- npm config set progress false
- npm config set spin false
# print versions
- echo "--------------------------"
- uname -a
- which node; file `which node`
- node --version
- node -p 'process.platform + "@" + process.arch'
- npm --version
# figure out if we should publish
- PUBLISH_BINARY=false
- echo $TRAVIS_BRANCH
- echo `git describe --tags --always HEAD`
- if [[ $TRAVIS_BRANCH == `git describe --tags --always HEAD` ]]; then PUBLISH_BINARY=$BINARY_BUILDER; fi;
- echo "Publishing native platform Binary Package? ->" $PUBLISH_BINARY
install:
# ensure source install works
#- export V=1
- npm run prepublish
- npm install --build-from-source
script:
- npm test
# inspect library dependencies
- >
if [[ $TRAVIS_OS_NAME == "linux" ]]; then
ldd ./build/Release/HID.node
else
otool -L ./build/Release/HID.node
fi;
# if publishing, do it
- >
if [[ $PUBLISH_BINARY == true ]]; then
npm run prebuild-upload;
fi;
# after_success:
# - bash <(curl -s https://codecov.io/bash)