forked from RPG-Paper-Maker/RPG-Paper-Maker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
121 lines (114 loc) · 3.06 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
language: cpp
env:
linux: &linux_env
- PROCESSORS="$(nproc)" # should be 2
osx: &osx_env
- PROCESSORS="$(sysctl -n hw.ncpu)" # should be 2
# Linux needs OpenGL
# `matrix` tends to ignore apt packages defined at the top,
# so define a list here and reference it in each linux config
addons:
apt:
packages: &linux_packages
- libglu1-mesa-dev
# OSX needs to install subversion to use `svn` in update-mods
addons:
homebrew:
packages:
- subversion
matrix:
include:
# our Qt PPA only supports Qt 5.15.0 on Ubuntu Focus,
# which Travis doesn't have yet, so we stick to 5.14.2
- os: linux
dist: xenial
sudo: required
compiler: gcc
env:
- *linux_env
- QT_MAJOR=5
- QT_MINOR=14
- QT_PATCH=2
- DIST=xenial
addons:
apt:
packages:
- *linux_packages
- os: linux
dist: bionic
sudo: required
compiler: gcc
env:
- *linux_env
- QT_MAJOR=5
- QT_MINOR=14
- QT_PATCH=2
- DIST=bionic
addons:
apt:
packages:
- *linux_packages
- os: osx
osx_image: xcode11.6
compiler: clang
env:
- *osx_env
# current brew stable is 5.15.0
- QT_MAJOR=5
- os: osx
osx_image: xcode12
compiler: clang
env:
- *osx_env
# current brew stable is 5.15.0
- QT_MAJOR=5
before_install:
- |
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
export QT_FULL="${QT_MAJOR}.${QT_MINOR}.${QT_PATCH}" # ex: 5.15.0
export QT_SHORT="${QT_MAJOR}${QT_MINOR}" # ex: 515
sudo add-apt-repository -y ppa:beineri/opt-qt-${QT_FULL}-${DIST}
sudo apt-get update -qq
sudo apt-get install -qq qt${QT_SHORT}base qt${QT_SHORT}multimedia
fi
- |
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
brew update
brew install qt${QT_MAJOR}
fi
install:
- export QT_SELECT=qt${QT_MAJOR}
- $CXX --version
- |
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
. /opt/qt${QT_SHORT}/bin/qt${QT_SHORT}-env.sh
fi
- |
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
brew link --force qt${QT_MAJOR}
fi
- ./update-mods
script:
- qmake -v
- qmake -r "QMAKE_CXX=$CXX" "QMAKE_CC=$CC"
# g++ fails with virtual memory exhausted when too many processes are running
# so don't use -j with it in.
# In counterpart, `make` on Xenial will take more than 10mn, so to prevent
# Travis from shutting down the process, use travis_wait to extend time to 20mn
# by logging every minute for that duration.
- |
echo "Processors found on virtual machine: ${PROCESSORS}"
if [ "$CXX" = "g++" ]; then
echo "g++: do not use parallel jobs to avoid virtual memory exhaustion"
travis_wait make -s
else
echo "clang: use ${PROCESSORS} parallel jobs"
make -j${PROCESSORS} -s
fi
# Run with X11 display on Linux as some tests require a Qt app
- |
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
xvfb-run make -k check
else
make -k check
fi