Browse Source

Merge pull request #3512 from Chocobo1/travis

Migrate TravisCI to container-based infrastructure
adaptive-webui-19844
sledgehammer999 9 years ago
parent
commit
3362766cb5
  1. 78
      .travis.yml

78
.travis.yml

@ -1,5 +1,4 @@
language: language: cpp
- cpp
env: env:
matrix: matrix:
@ -22,52 +21,73 @@ notifications:
on_success: change on_success: change
on_failure: change on_failure: change
# container-based builds
sudo: false
cache:
directories:
- $HOME/.ccache
addons:
coverity_scan:
project:
name: "qbittorrent/qBittorrent"
description: "Build submitted via Travis CI"
build_command_prepend: "./bootstrap.sh && ./configure $qbtconf"
build_command: make
branch_pattern: $coverity_branch
notification_email: sledgehammer999@qbittorrent.org
apt:
packages:
# packages list: https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise
- autoconf
- automake
- colormake
- libssl-dev
- libboost-dev
- libboost-system-dev
- libgeoip-dev
- libqt4-dev
# Uncomment when Travis upgraded "Ubuntu 12.04 LTS" to a newer version whose repo will have a more up-to-date libtorrent package
#- libtorrent-rasterbar6
#- libboost-filesystem-dev
before_install: before_install:
# Only allow specific build for coverity scan, others will stop # Only allow specific build for coverity scan, others will stop
- if [ "$TRAVIS_BRANCH" = "$coverity_branch" ] && ! [[ "$lt_branch" == "RC_1_0" && "$gui" == "true" ]]; then exit ; fi - if [ "$TRAVIS_BRANCH" = "$coverity_branch" ] && ! [[ "$lt_branch" == "RC_1_0" && "$gui" == "true" ]]; then exit ; fi
- shopt -s expand_aliases - shopt -s expand_aliases
- alias sudo="sudo " - if ! [ "$TRAVIS_BRANCH" = "$coverity_branch" ]; then dpkg-query -L ccache && export PATH="/usr/lib/ccache/:$PATH" ; fi
# Using nprocs/2 sometimes may fail (gcc is killed by system), just use two threads - alias make="colormake -j3" # Using nprocs/2 sometimes may fail (gcc is killed by system)
- alias make="colormake -j2 "
- libt_path="$HOME/libt_install"
- qbt_path="$HOME/qbt_install"
- ltconf="$ltconf --prefix="$libt_path" --with-libgeoip=system"
- qbtconf="$qbtconf --prefix="$qbt_path" PKG_CONFIG_PATH="$libt_path/lib/pkgconfig":$PKG_CONFIG_PATH"
# Options for specific branches
# Also setup a virtual display for after_success target when gui == true # Also setup a virtual display for after_success target when gui == true
- if ! $gui; then qbtconf="$qbtconf --disable-gui" ; else export "DISPLAY=:99.0" && /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16 ; fi - if ! $gui; then qbtconf="$qbtconf --disable-gui" ; else export "DISPLAY=:99.0" && /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16 ; fi
- qbtconf="$qbtconf --with-qt4"
- ltconf=" --with-libgeoip=system"
# Print settings # Print settings
- echo $lt_branch - echo $lt_branch
- echo $gui - echo $gui
- echo $qbtconf
- echo $ltconf - echo $ltconf
- echo $qbtconf
- sudo apt-get -qq update - ccache -V && ccache --show-stats && ccache --zero-stats
# Travis may stall during heavy load if these packages are installed in one step - split the command
- sudo apt-get -qq install debhelper autoconf automake colormake libssl-dev libgeoip-dev
# Uncomment when Travis upgraded "Ubuntu 12.04 LTS" to a newer version whose repo will have a more up-to-date libtorrent package
#- sudo apt-get -qq install libboost-dev libboost-filesystem-dev libboost-system-dev
- sudo apt-get -qq install libboost-dev libboost-system-dev
- sudo apt-get -qq install libqt4-dev
install: install:
- if ! [ "$lt_branch" == "dist" ]; then cd .. && git clone --depth 1 https://github.com/arvidn/libtorrent.git --branch $lt_branch --single-branch ; fi - if ! [ "$lt_branch" == "dist" ]; then cd "$HOME" && pwd && git clone --depth 1 https://github.com/arvidn/libtorrent.git --branch $lt_branch --single-branch ; fi
- if ! [ "$lt_branch" == "dist" ]; then cd libtorrent && ./autotool.sh && ./configure $ltconf && sudo make install && sudo ldconfig /usr/local/lib && cd $TRAVIS_BUILD_DIR ; fi - if ! [ "$lt_branch" == "dist" ]; then cd libtorrent && ./autotool.sh && ./configure $ltconf && make install && cd "$TRAVIS_BUILD_DIR" ; fi
script: script:
- if [ "$TRAVIS_BRANCH" = "$coverity_branch" ]; then exit ; fi # Skip usual build when running coverity scan - if [ "$TRAVIS_BRANCH" = "$coverity_branch" ]; then exit ; fi # Skip usual build when running coverity scan
- ./bootstrap.sh && ./configure $qbtconf - ./bootstrap.sh && ./configure $qbtconf
- sudo make install - make install
after_success: after_success:
- if $gui ; then qbittorrent --version ; else qbittorrent-nox --version ; fi - cd "$qbt_path/bin"
- export LD_PRELOAD="$libt_path/lib/libtorrent-rasterbar.so:$LD_PRELOAD"
- if $gui ; then ./qbittorrent --version ; else ./qbittorrent-nox --version ; fi
addons: after_script:
coverity_scan: - ccache --show-stats
project:
name: "qbittorrent/qBittorrent"
description: "Build submitted via Travis CI"
build_command_prepend: "./bootstrap.sh && ./configure $qbtconf"
build_command: make
branch_pattern: $coverity_branch
notification_email: sledgehammer999@qbittorrent.org

Loading…
Cancel
Save