forked from moneymanagerex/moneymanagerex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
210 lines (197 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
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
language: cpp
dist: bionic
sudo: required
services: [ docker ]
git: { depth: false }
os: linux # default build params for matrix
compiler: gcc
cache: ccache
env:
global:
- CCACHE_SLOPPINESS=time_macros
- CMAKE_BUILD_PARALLEL_LEVEL=4
- MAKEFLAGS=-j$CMAKE_BUILD_PARALLEL_LEVEL
- BUILD_TYPE=$(if [[ "$TRAVIS_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then if [[ "$TRAVIS_TAG" =~ -[a-z] ]]; then echo RelWithDebInfo; else echo Release; fi; else echo Debug; fi)
matrix: # targets for linux
# Ubuntu
- OS=ubuntu DIST=bionic
- OS=ubuntu DIST=focal
- OS=ubuntu DIST=groovy
- OS=ubuntu DIST=xenial
# Debian
# - OS=debian DIST=buster # see issue #1331 on GitHub
- OS=debian DIST=buster
- OS=debian DIST=stretch
# Fedora
- OS=fedora DIST=31
# Open SuSe
# - OS=opensuse # see issue #1903 on GitHub
- OS=opensuse DIST=42.2
# Arch Linux
- OS=archlinux
# elementary OS
- OS=el DIST=8
# Linux Mint
- OS=linuxmint DIST=tricia
- OS=linuxmint DIST=tina
- OS=linuxmint DIST=tessa
- OS=linuxmint DIST=tara
- OS=linuxmint DIST=sylvia
matrix:
allow_failures:
- os: debian
dist: buster
- os: ubuntu
dist: xenial
- os: ubuntu
dist: bionic
- os: ubuntu
dist: groovy
- os: ubuntu
dist: focal
- os: fedora
- os: fedora
dist: 30
- os: fedora
dist: 31
- os: opensuse
- os: opensuse
dist: 42.2
- os: archlinux
- os: el
dist: 8
- os: linuxmint
dist: sylvia
- os: linuxmint
dist: tara
- os: linuxmint
dist: tessa
- os: linuxmint
dist: tina
- os: linuxmint
dist: tricia
fast_finish: true
include: # add non-linux targets
- { os: osx, osx_image: xcode11.2, env: OS=macos DIST=10.14, compiler: clang }
- stage: nightly # used only to tag and trigger nightly build
sudo: false
cache: pip
services: [ ]
git: { submodules: false, depth: 10 }
install: skip
before_script:
- git config --global credential.helper store
- echo "https://$GitHub_auth_token:[email protected]" >$HOME/.git-credentials
- git config --global user.email "[email protected]"
- git config --global user.name "Travis CI"
script:
- git tag -f nightly && git push -f --tags
after_success: skip
deploy: skip
stages:
- name: nightly
if: type IN (api, cron)
- name: test
if: NOT type IN (api, cron)
install: |-
case $TRAVIS_OS_NAME in
linux)
DOCKER=moneymanagerex/mmex_build_env:$OS${DIST:+.$DIST}${ARCH:+.$ARCH}
ccache -cs || true
docker pull ${DOCKER}
docker build dockers/$OS${DIST:+.$DIST}${ARCH:+.$ARCH} --cache-from ${DOCKER} -t ${DOCKER}
;;
osx)
export MACOSX_DEPLOYMENT_TARGET=$DIST
brew update && brew bundle --verbose --file=util/Brewfile
ccache -cs && export PATH="/usr/local/opt/ccache/libexec:$PATH"
cd $HOME
curl -fsSL -O http://ftp.gnu.org/gnu/gettext/gettext-0.20.2.tar.gz
tar xzvf gettext-0.20.2.tar.gz
cd gettext-0.20.2
./configure
make
make install
cd $HOME
curl -fsSL -O https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.6/wxWidgets-3.1.5.tar.bz2
tar xzf wxWidgets-*.tar.bz2
cd wxWidgets-3.1.5
./configure --disable-shared --enable-cxx11 --with-cxx=11 \
--with-macosx-version-min=$MACOSX_DEPLOYMENT_TARGET \
--without-libtiff
make install
;;
esac
before_script:
- cd $TRAVIS_BUILD_DIR/src/db
- python ../../util/sqlite2cpp.py ../../database/tables_v1.sql && rm -f sql*.sql *.mmdbg
- python ../../util/sqliteupgrade2cpp.py ../../database
- cd ../.. && mkdir build && cd build
script: |-
CMAKE_CMD="cmake ${ARCH:+-DCMAKE_TOOLCHAIN_FILE=util/toolchain-$TRAVIS_OS_NAME-$ARCH.cmake} .."
case $TRAVIS_OS_NAME in
linux)
chmod -fR a+rwX $HOME/.ccache
docker run -it --rm -w /moneymanagerex/build -e MAKEFLAGS \
-v $HOME/.ccache:/root/.ccache \
-v $TRAVIS_BUILD_DIR:/moneymanagerex ${DOCKER} \
bash -c "$CMAKE_CMD -DCMAKE_BUILD_TYPE=$BUILD_TYPE && cmake --build . --target package && eval \$MMEX_INST_CMD"
;;
osx)
export CXXFLAGS=-stdlib=libc++ # exports required by Xcode 10 or later
export LDFLAGS=-stdlib=libc++
$CMAKE_CMD -G Xcode && cmake --build . --target package --config $BUILD_TYPE -- \
CC=/usr/local/opt/ccache/libexec/clang \
CPLUSPLUS=/usr/local/opt/ccache/libexec/clang++ | \
xcpretty -c -f `xcpretty-travis-formatter`; test ${PIPESTATUS[0]} -eq 0
;;
esac
notifications: # set notification options
email:
recipients:
on_success: change # change is when the repo status goes from pass to fail or vice versa
on_failure: always
after_success:
- ccache -cs || true
# Rename mac packages
- if [ $TRAVIS_OS_NAME = osx ]; then
for p in *.dmg; do mv -v $p ${p%Darwin.*}$OS.dmg; done; fi
# Rename files for GH Releases upload as workaround for travis-ci/dpl#821
before_deploy: |-
if [[ ! -d gh_releases ]]; then
mkdir gh_releases
for f in *.{deb,rpm,dmg,txz,pkg.tar.xz}; do
if [[ -e "$f" ]]; then cp -v "$f" "gh_releases/${f//\~/.}"; fi
done
fi
# Set encrypted variable 'GitHub_auth_token' in Travis repo settings to deploy packages
# for tagged commits to GitHub Releases.
# Set encrypted variable 'PACKAGECLOUD_TOKEN' in Travis repo settings to deploy packages
# for tagged commits to packagecloud repo.
deploy:
- provider: releases
api_key: $GitHub_auth_token
file_glob: true
file: gh_releases/*.{deb,rpm,dmg,txz,pkg.tar.xz}
skip_cleanup: true
prerelease: true
overwrite: true
on: # Set deploy conditions
# Deploy only when tag is specified
tags: true
# and only when API token is set
condition: ${#GitHub_auth_token} != 0
- provider: packagecloud
repository: ${TRAVIS_REPO_SLUG#*/}
username: ${TRAVIS_REPO_SLUG%/*}
token: $PACKAGECLOUD_TOKEN
dist: $OS/$DIST
package_glob: ./*.{deb,rpm}
skip_cleanup: true
on: # Set deploy conditions
# Deploy only when tag is specified
tags: true
# and only packages generated by gcc from Linux
# and only when API token is set
condition: $TRAVIS_OS_NAME = linux && ${#DIST} != 0 && $OS != slackware && ${#PACKAGECLOUD_TOKEN} != 0 && $TRAVIS_TAG != nightly