-
Notifications
You must be signed in to change notification settings - Fork 18
/
.travis.yml
114 lines (91 loc) · 6.19 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
sudo: false
addons:
apt:
packages:
- unzip
- make
- cmake-data
- cmake
- libglu1-mesa-dev
- libgl1-mesa-dev
- libfontconfig-dev
matrix:
include:
- os: linux
language: c++
jdk: openjdk11
install: true
- os: osx
language: c++
osx_image: xcode10.1
install: true
#cache:
#ccache: true
#directories:
#- $HOME/Library/Caches/Homebrew
# TODO: how can we do conditional caching of directories (depending on OS)
#- /home/travis/build/miho/OCC-CSG/oce-OCE-0.18.3
#- /Users/travis/build/miho/OCC-CSG/oce-OCE-0.18.3
env:
global:
#- OCC_VERSION="occ-dev-2019-02-13"
#- OCC_VERSION="v7.2.0.1"
- OCC_VERSION="v7.4.0"
# we don't use 7.3 because of bad boolean code - OCC_VERSION="v7.3.0.2"
#- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then PATH=/usr/lib/ccache:${PATH}; fi
- TIMEOUT_BUILD='30m'
- BUILD_SUCCESS=true
before_install:
# installing ccache and freetype packages via homebrew
#- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ccache; fi
#- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH="/usr/local/opt/ccache/libexec:$PATH"; fi
# adding timeout command to path for os x
#- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then PATH="$PATH:/usr/local/opt/coreutils/libexec/gnubin"; fi
script:
- export OUR_DIR=$(pwd)
- echo "home directory $OUR_DIR"
# downloading occ
- mkdir -p dependencies
- cd dependencies
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then curl https://github.com/miho/occ-for-occ-csg/releases/download/$OCC_VERSION/opencascade-$OCC_VERSION-linux-x64.zip -LO ; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then unzip opencascade-$OCC_VERSION-linux-x64.zip > /dev/null ; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then curl https://github.com/miho/occ-for-occ-csg/releases/download/$OCC_VERSION/opencascade-$OCC_VERSION-macos.zip -LO ; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then unzip opencascade-$OCC_VERSION-macos.zip > /dev/null ; fi
- cd $OUR_DIR
# setting OCC install dir
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export OCC_INSTALL_DIR=$OUR_DIR/dependencies/opencascade-$OCC_VERSION-macos/lib/cmake/opencascade; mv $OUR_DIR/dependencies/opencascade-$OCC_VERSION-macos/lib/libfreetype.a.6 $OUR_DIR/dependencies/opencascade-$OCC_VERSION-macos/lib/libfreetype.a ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export OCC_INSTALL_DIR=$OUR_DIR/dependencies/opencascade-$OCC_VERSION-linux-x64/lib/cmake/opencascade; cp $OUR_DIR/dependencies/opencascade-$OCC_VERSION-linux-x64/lib/libfreetype.a.6 $OUR_DIR/dependencies/opencascade-$OCC_VERSION-linux-x64/lib/libfreetype.a ; fi
# finally build and test occ-csg
- cd $OUR_DIR
- mkdir -p build && cd build
- (! $BUILD_SUCCESS && echo ">> skipping build until ccache and compilation of oce works. restart task or schedule new task.") || cmake .. -DOpenCASCADE_DIR=$OCC_INSTALL_DIR -DFontConfig:FILEPATH=/usr/lib/x86_64-linux-gnu/libfontconfig.so -DFreeType:FILEPATH=$OUR_DIR/dependencies/opencascade-$OCC_VERSION-linux-x64/lib/libfreetype.a
- (! $BUILD_SUCCESS && echo ">> skipping build until ccache and compilation of oce works. restart task or schedule new task.") || make && bin/occ-csg --help
# test the functionality (by computing volumes of different objects)
- cd $OUR_DIR && cd test-suite
- java ./Test.java
before_deploy:
- cd $OUR_DIR
- mkdir release && cd release
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mkdir -p occ-csg-$TRAVIS_TAG-macos/bin; cp $OUR_DIR/build/bin/occ-csg occ-csg-$TRAVIS_TAG-macos/bin; cp $OUR_DIR/README.md occ-csg-$TRAVIS_TAG-macos/; cp $OUR_DIR/THIRDPARTY-LICENSES occ-csg-$TRAVIS_TAG-macos/; cp $OUR_DIR/LICENSE occ-csg-$TRAVIS_TAG-macos/ ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then zip -r occ-csg-$TRAVIS_TAG-macos.zip occ-csg-$TRAVIS_TAG-macos/; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mkdir -p occ-csg-$TRAVIS_TAG-linux-x64/bin; cp $OUR_DIR/build/bin/occ-csg occ-csg-$TRAVIS_TAG-linux-x64/bin; cp $OUR_DIR/README.md occ-csg-$TRAVIS_TAG-linux-x64/; cp $OUR_DIR/THIRDPARTY-LICENSES occ-csg-$TRAVIS_TAG-linux-x64/; cp $OUR_DIR/LICENSE occ-csg-$TRAVIS_TAG-linux-x64/ ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then zip -r occ-csg-$TRAVIS_TAG-linux-x64.zip occ-csg-$TRAVIS_TAG-linux-x64/; fi
deploy:
- provider: releases
api_key:
secure: zjSgPQIowqYPUILskt3+Bn1+wfvJsIQz4INZbusPRMCJvLchQzIxvejURPqb7f067cDbHXFoUjGydgHz6WdIFhp31scML5816enBTQeVOgKwc3cLlV2FY9i/ymxckF7fnJ0DTyz6f99bGx8oQSglNfiyOt8JO6pYzB7ZpEQaGByqyYiBsXGjAEauezbux1jNPo5B8yt4cwfy/uH9RvCpNMXgbJSFqm87nfrovAbzVda6hjLPWeY7AmP3aO9Vv0YL7nYXrbyYLYkyO/lKz87jVCvxWW03rDo+5oAfCcZJAQ/4+Mhek6YeiqWC+kg7V35xRlbt6l5VJnB1UFQTnNXbvPps7EM0c0/0O4mBcMegIojdvApNV4U960ssa4e2jekhP6TsLBuPgwasoh7lYFWcX5IqtEbtJAKTBIO7ghPnSbLQmcrx57cTghFX8lJJVJsYSWOzKs5FZv3XdtKqK6fwqR3icjwTkuVuiTCn1/uXu8KCnTyyMhXKaLMZw0a5dP9MH4ZRNmFD8X5i9ZdLdV0e9T05GHSj7vNy9+dNi6AGX0j18LSrlnw9FDCkRk2YtWA5T/oSoJ8WEYa/i/2S30propGJt2xtN+2qW8QBq23zquNleh1VZwy31imXPlTx3r5ZQWNKE3hBWLnmoY87qkaIk0jZqX6bWw+KUleNT7lfIfk=
skip_cleanup: true
file: $OUR_DIR/release/occ-csg-$TRAVIS_TAG-linux-x64.zip
on:
condition: $TRAVIS_OS_NAME = linux
tags: true
#repo: miho/OCC-CSG
- provider: releases
api_key:
secure: zjSgPQIowqYPUILskt3+Bn1+wfvJsIQz4INZbusPRMCJvLchQzIxvejURPqb7f067cDbHXFoUjGydgHz6WdIFhp31scML5816enBTQeVOgKwc3cLlV2FY9i/ymxckF7fnJ0DTyz6f99bGx8oQSglNfiyOt8JO6pYzB7ZpEQaGByqyYiBsXGjAEauezbux1jNPo5B8yt4cwfy/uH9RvCpNMXgbJSFqm87nfrovAbzVda6hjLPWeY7AmP3aO9Vv0YL7nYXrbyYLYkyO/lKz87jVCvxWW03rDo+5oAfCcZJAQ/4+Mhek6YeiqWC+kg7V35xRlbt6l5VJnB1UFQTnNXbvPps7EM0c0/0O4mBcMegIojdvApNV4U960ssa4e2jekhP6TsLBuPgwasoh7lYFWcX5IqtEbtJAKTBIO7ghPnSbLQmcrx57cTghFX8lJJVJsYSWOzKs5FZv3XdtKqK6fwqR3icjwTkuVuiTCn1/uXu8KCnTyyMhXKaLMZw0a5dP9MH4ZRNmFD8X5i9ZdLdV0e9T05GHSj7vNy9+dNi6AGX0j18LSrlnw9FDCkRk2YtWA5T/oSoJ8WEYa/i/2S30propGJt2xtN+2qW8QBq23zquNleh1VZwy31imXPlTx3r5ZQWNKE3hBWLnmoY87qkaIk0jZqX6bWw+KUleNT7lfIfk=
skip_cleanup: true
file: $OUR_DIR/release/occ-csg-$TRAVIS_TAG-macos.zip
on:
condition: $TRAVIS_OS_NAME = osx
tags: true
#repo: miho/OCC-CSG