-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.travis.yml
138 lines (119 loc) · 4.71 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
127
128
129
130
131
132
133
134
135
136
137
138
language: cpp
addons:
# Ubuntu dependencies
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- zlib1g-dev
- libssl-dev
- zip
- lcov
- cppcheck
jobs:
include:
#
- os: linux
name: Ubuntu 16.04
dist: xenial
env:
- PKG_BUILD="DEB"
- PKG_EXT="deb"
#
- os: linux
name: Ubuntu 18.04
dist: bionic
env:
- PKG_BUILD="DEB"
- PKG_EXT="deb"
#
- os: osx
name: Mac OSX
osx_image: xcode10.1 # for CLANG 3.1
env:
- HOMEBREW_NO_AUTO_UPDATE=1
- PKG_BUILD="ZIP"
- PKG_EXT="pkg"
before_install:
# Force replace GCC to v7 in Ubuntu Xenial 16.04
- if [ $(lsb_release -rs) == "16.04" ]; then
sudo update-alternatives --remove-all gcc ;
sudo update-alternatives --remove-all g++ ;
sudo apt-get install gcc-7 g++-7 ;
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 99 ;
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 99 ;
gcc -v && g++ -v && cmake --version ;
fi
# Install Deps, install Argos with 60 mins timeout
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
brew tap ilpincy/argos3 ;
travis_wait 60 brew install argos3 ;
brew install openssl zlib libuv cppcheck lcov ;
fi
install:
################### Download from Google drive for linux ###################
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1OVKPMZFa0GzSU1RwioaEReUCUl-vngkR' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1OVKPMZFa0GzSU1RwioaEReUCUl-vngkR" -O argos3_simulator-3.0.0-x86_64-beta56.deb && rm -rf /tmp/cookies.txt ;
sudo dpkg -i argos3_simulator-3.0.0-x86_64-beta56.deb ;
sudo apt install -f ;
fi
######################### Build package for testing #########################
before_script:
- mkdir -p build
- cd build
- cmake -DCMAKE_BUILD_TYPE=Debug ../src
- cmake --build . --target all --parallel
# Run coverage & test
- cmake --build . --target coverage
# Output coverage data for debugging (optional)
- lcov --list coverage.info
# Uploading to CodeCov
# '-f' specifies file(s) to use and disables manual coverage gathering and file search which has already been done above
- bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"
# Uploading to codacy
- CODACY_PROJECT_TOKEN=$CODACY_PROJECT_TOKEN bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage.info --language Cpp --force-language
########################## Build package for deploy ##########################
- cd ..
- rm -rf build
- mkdir -p build
- cd build
- cmake -DCMAKE_BUILD_TYPE=Release ../src
- cmake --build . --target all --parallel
############################### Bundle packages ##############################
script:
# Get filename variable from CMake
- EXPORT_PACKAGE_NAME=$(cat package_name.txt)
# New filename if linux
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
EXPORT_FILE_NAME=${EXPORT_PACKAGE_NAME}-$(lsb_release -is)_$(lsb_release -sr).${PKG_EXT};
fi
# New filename if OSX
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
EXPORT_FILE_NAME=${EXPORT_PACKAGE_NAME}-OSX.${PKG_EXT};
fi
# Build package
- cpack -G ${PKG_BUILD}
## For OSX, convert zip output to pkg
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
pkgbuild --root "./_CPack_Packages/Darwin/ZIP/${EXPORT_PACKAGE_NAME}" --identifier "com.argos3.plugins.webviz" --install-location "/" --ownership recommended pkg_output.pkg ;
productbuild --distribution ../src/packaging/darwin/distribution.xml --package-path "./_CPack_Packages/Darwin/ZIP/${EXPORT_PACKAGE_NAME}" ${EXPORT_FILE_NAME} ;
fi
# For linux, rename files with ubuntu version
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
mv ${EXPORT_PACKAGE_NAME}.${PKG_EXT} ${EXPORT_FILE_NAME};
fi
# Combine Client files into zip
- cd .. && zip -r web_client.zip client
############################### Deploy packages ##############################
deploy:
- provider: releases
api_key: $GITHUB_OAUTH_ACCESS_TOKEN
file:
- "build/${EXPORT_FILE_NAME}"
- web_client.zip
- README.md
- LICENSE
skip_cleanup: true
prerelease: true
overwrite: true
draft: true