-
Notifications
You must be signed in to change notification settings - Fork 155
/
.travis.yml
227 lines (214 loc) · 8.69 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# boards are ordered by priority so that when monitoring a build developers get feedback on the important ones first.
matrix:
#Do not define 'global' env vars here. They cannot be used with API builds
fast_finish: true
include:
- stage: nightly
env: MAKETARGET="zips winzips"
- stage: release
env: MAKETARGET="zips winzips"
- stage: build
env: MAKETARGET=lint
- env: MAKETARGET=zip_devo8
- env: MAKETARGET=zip_devo10
- env: MAKETARGET=zip_devo12
- env: MAKETARGET=zip_devo7e
- env: MAKETARGET=zip_devof12e
- env: MAKETARGET=zip_t8sg
- env: MAKETARGET=zip_at9
- env: MAKETARGET=zip_devof7
- env: MAKETARGET=zip_t12
- env: MAKETARGET=zip_win_emu_devo8
- env: MAKETARGET=zip_emu_devo8
- env: MAKETARGET=test
stages:
- name: release
if: type = api AND branch =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/
- name: nightly
if: type IN (api, cron) and branch = "master"
- name: build
if: type NOT IN (api, cron)
# if: type NOT IN (api, cron) AND NOT commit_message =~ /^Updating translations from Transifex \(Languages:/
# We still need to rebuild even if the last commit was from transifex to calculate rom size and verify string lengths
dist: trusty
addons:
apt:
update: false
packages:
- build-essential
- mingw32
- mingw32-binutils
- mingw32-runtime
- libfltk1.3-dev
- gcovr
- python3
- python3-pip
language: minimal
#Do NOT set these. They set 'CC' which breaks the build
#compiler: gcc
git:
depth: 5
before_install:
# We'll put env variables global to all builds here
# Disable python SSL warnings (only needed for trusty)
- export PYTHONWARNINGS="ignore:A true SSLContext object is not available,ignore:An HTTPS request has been made"
- export GITHUB_TOKEN='789c538d758e0a718c8ae537b7f6656776e20d768de18d546014e20876e1898933cd94648f75e06117e20000b71f080d'
# TRAVIS does not override the TRAVIS_COMMIT_MSG with the 'message' value passed via the API (travis issue #10184)
- source <(curl -s -L "https://api.travis-ci.org/repos/$TRAVIS_REPO_SLUG/builds/$TRAVIS_BUILD_ID" | python3 -c 'import sys, json; a = json.load(sys.stdin); print("export TRAVIS_COMMIT_MSG=\"" + a.get("message","").replace("\"", "\\\"") + "\"")')
install:
- |
export reqs=""
case $MAKETARGET in
test) export reqs="$reqs test" ;;
lint) export reqs="$reqs lint" ;;
*win*) export reqs="$reqs win" ;;&
*emu*) ;; # catch emulator builds that don't need arm
*) export reqs="$reqs arm" ;;
esac
echo "Requirements: $reqs"
# These are separated to make it easier to visualize the build in the travis logs
- if [[ $reqs == *"test"* ]]; then pip3 install --user cpp-coveralls; fi
- if [[ $reqs == *"lint"* ]]; then pip3 install --user cpplint==1.3.0; fi
- |
if [[ $reqs == *"arm"* ]]; then
if [[ ! -d "$HOME/gcc-arm-none-eabi-8-2018-q4-major/bin" ]]; then
pushd $HOME
curl --retry 10 --retry-max-time 120 -L \
"https://developer.arm.com/-/media/Files/downloads/gnu-rm/8-2018q4/gcc-arm-none-eabi-8-2018-q4-major-linux.tar.bz2" | tar xfj -
popd;
popd
fi
export PATH=$PATH:$HOME/gcc-arm-none-eabi-8-2018-q4-major/bin
fi
- |
if [[ $reqs == *"win"* ]]; then
if [[ ! -d "$HOME/fltk-1.3.0-w32/bin" ]]; then
# don't build 'tests' because they don't work on a cross-compile, so we need to specify 'DIRS' explicitly
mkdir $HOME/src
mkdir $HOME/fltk-1.3.0-w32
pushd $HOME/src
curl --retry 10 --retry-max-time 120 -L "http://fltk.org/pub/fltk/1.3.0/fltk-1.3.0-source.tar.gz" | tar xzf -
cd fltk-1.3.0
./configure --prefix=$HOME/fltk-1.3.0-w32 --enable-localzlib --enable-localpng --disable-gl --host=i586-mingw32msvc && \
make -j2 DIRS="jpeg zlib png src fluid" && \
make install DIRS="jpeg zlib png src fluid"
popd
fi
export FLTK_DIR=$HOME/fltk-1.3.0-w32
fi
- |
if [[ $reqs == *"win"* ]]; then
if [[ ! -d "$HOME/portaudio-w32/bin" ]]; then
mkdir $HOME/src
mkdir $HOME/portaudio-w32
pushd $HOME/src
curl --retry 10 --retry-max-time 120 -L "http://www.portaudio.com/archives/pa_stable_v19_20140130.tgz" | tar xzf -
cd portaudio
./configure --prefix=$HOME/portaudio-w32 --host=i586-mingw32msvc && \
make -j2 install
popd
fi
export PORTAUDIO_DIR=$HOME/portaudio-w32
fi
- |
if [[ $reqs == *"win"* ]]; then
if [[ ! -d "$HOME/mpg123-w32/bin" ]]; then
mkdir $HOME/src
mkdir $HOME/mpg123-w32
pushd $HOME/src
curl --retry 10 --retry-max-time 120 -L "http://www.mpg123.de/download/mpg123-1.23.8.tar.bz2" | tar xjf -
cd mpg123-1.23.8
./configure --prefix=$HOME/mpg123-w32 --host=i586-mingw32msvc --disable-shared && make && \
make -j2 install
strip --strip-unneeded $HOME/mpg123-w32/bin/mpg123.exe
popd
fi
export MPG123_DIR=$HOME/mpg123-w32
fi
- |
if [[ $TRAVIS_BUILD_STAGE_NAME == "nightly" || $TRAVIS_BUILD_STAGE_NAME == "release" ]]; then
pip3 install --user urllib3==1.23 transifex-client
openssl aes-256-cbc -K $encrypted_54cd4d6ff016_key -iv $encrypted_54cd4d6ff016_iv -in install_nightlies.tar.enc -out install_nightlies.tar -d
tar -xf install_nightlies.tar;
rm -f install_nightlies.tar
fi
- |
if [[ $TRAVIS_BUILD_STAGE_NAME == "nightly" ]]; then
echo "[https://www.transifex.com]" > .transifexrc;
echo "hostname = https://www.transifex.com" >> .transifexrc;
echo "password = $TX_PASSWD" >> .transifexrc;
echo "username = api" >> .transifexrc
git config --global user.email "[email protected]";
git config --global user.name "Travis CI";
git config --global credential.helper store;
echo "https://$GH_TOKEN:[email protected]" >> ~/.git-credentials
fi
before_script:
- env | sort
- arm-none-eabi-gcc --version 2> /dev/null | true
script:
- |
if [[ $TRAVIS_BUILD_STAGE_NAME == "nightly" ]]; then
# 'make language' changes order randomly. Needs to be consistent before enabling this
pushd src; make language; popd;
if [[ `git diff src/fs/language/| grep -E -v '^(diff|index|---|\+\+\+|@@|-#|\+#| |$)'` == "" ]]; then
# Do not update if only comments have changed
echo "Only comment-changes found in deviation.po. Ignoring"
git checkout -- src/fs/language/
else
tx push -s
git diff
fi
tx pull -f -a
./utils/clean_transifex_merge.py src/fs/language/locale
git add src/fs/language
git commit -m "`utils/get_altered_languages.py 'Updating translations from Transifex'`"
git push origin HEAD:$TRAVIS_BRANCH > /dev/null 2>&1 && echo "Successfully uploaded new translations to Github."
# check if we've already built a nightly from the current commit
if ! utils/needs_nightly_rebuild.py; then
travis_terminate 0
fi
fi
- cd src
- make -j2 $MAKETARGET
- |
if [[ "$TRAVIS_EVENT_TYPE" == "push" || "$TRAVIS_EVENT_TYPE" == "pull_request" ]]; then
../utils/archive_build_size.py "$MAKETARGET" || /bin/true;
fi
- |
if [[ "$MAKETARGET" == "test" ]]; then
./test.elf;
fi
- |
if [[ "$MAKETARGET" == "test" ]]; then
../utils/coverage-summary.sh;
coveralls -r . -b . --gcov-options '\-lp' -E '.*/tests/test_.*' -E '.*/objs/' || true;
fi
after_success:
- |
if [[ $TRAVIS_BUILD_STAGE_NAME == "build" ]]; then
travis_terminate 0
fi
- |
if [[ $TRAVIS_BUILD_STAGE_NAME == "release" ]]; then
export RELEASE_VERSION=$(echo $TRAVIS_BRANCH | egrep -o '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+');
if [[ "$RELEASE_VERSION" != "" && "$TRAVIS_BRANCH" == "v$RELEASE_VERSION" ]]; then
echo "Releasing $RELEASE_VERSION";
../utils/upload_test_build.pl -skip -release "$RELEASE_VERSION" -delete;
../utils/upload_test_build.pl -skip -release "$RELEASE_VERSION" *.zip;
fi;
else
export NIGHTLY_DATE=$(date "+%Y-%m-%d");
if [[ "$NIGHTLY_DATE" != "" ]]; then
echo "Uploading Nightly - $NIGHTLY_DATE";
../utils/upload_test_build.pl -skip -nightly "$NIGHTLY_DATE" -delete;
../utils/upload_test_build.pl -skip -nightly "$NIGHTLY_DATE" *.zip;
fi
fi
cache:
apt: true
directories:
- $HOME/gcc-arm-none-eabi-8-2018-q4-major
- $HOME/fltk-1.3.0-w32
- $HOME/portaudio-w32
- $HOME/mpg123-w32