|
| 1 | +sudo: false |
1 | 2 | language: rust |
2 | | -os: |
3 | | - - linux |
4 | | - - osx |
| 3 | +cache: cargo |
| 4 | + |
| 5 | +env: |
| 6 | + global: |
| 7 | + # this will be part of the release tarball |
| 8 | + - PROJECT_NAME=colonize |
| 9 | + - RUST_BACKTRACE=1 |
| 10 | + # override the default '--features unstable' used for the nightly branch |
| 11 | + - TRAVIS_CARGO_NIGHTLY_FEATURE="nightly-testing" |
| 12 | + # encrypted Github token for doc upload |
| 13 | + - secure: "OtcCEFBniy4i89KaFKEOct+JsTQF3W3+6SYWlcB4FEvljRwwpAMWzpqoHQhfNLPQiX07Da+IlKrhM5wt2PPF80dEzyIxiK6Y/fJFgd0peAkbKYwqrgoS80WoqSHYBR8STb+X6JlhxxX+/pma+ILBBFQ6UH01KEHGISlHq4ARw58=" |
| 14 | +# the following are necessary for `travis-cargo coveralls --no-sudo` |
| 15 | +addons: |
| 16 | + apt: |
| 17 | + packages: |
| 18 | + - libcurl4-openssl-dev |
| 19 | + - libelf-dev |
| 20 | + - libdw-dev |
| 21 | + - binutils-dev # optional: only required for the --verify flag of coveralls |
| 22 | + |
| 23 | +matrix: |
| 24 | + fast_finish: true |
| 25 | + allow_failures: |
| 26 | + - rust: nightly |
| 27 | + include: |
| 28 | + # stable channel |
| 29 | + - os: osx |
| 30 | + rust: stable |
| 31 | + env: TARGET=i686-apple-darwin |
| 32 | + - os: linux |
| 33 | + rust: stable |
| 34 | + env: TARGET=i686-unknown-linux-gnu |
| 35 | + addons: |
| 36 | + apt: |
| 37 | + packages: &i686_unknown_linux_gnu |
| 38 | + # Cross compiler and cross compiled C libraries |
| 39 | + - gcc-multilib |
| 40 | + # freetype library |
| 41 | + - libfreetype6-dev:i386 |
| 42 | + - os: linux |
| 43 | + rust: stable |
| 44 | + env: TARGET=x86_64-unknown-linux-gnu |
| 45 | + # beta channel |
| 46 | + - os: osx |
| 47 | + rust: beta |
| 48 | + env: TARGET=i686-apple-darwin |
| 49 | + - os: linux |
| 50 | + rust: beta |
| 51 | + env: TARGET=i686-unknown-linux-gnu |
| 52 | + addons: |
| 53 | + apt: |
| 54 | + packages: *i686_unknown_linux_gnu |
| 55 | + - os: linux |
| 56 | + rust: beta |
| 57 | + env: TARGET=x86_64-unknown-linux-gnu |
| 58 | + # nightly channel |
| 59 | + - os: osx |
| 60 | + rust: nightly |
| 61 | + env: TARGET=i686-apple-darwin |
| 62 | + - os: linux |
| 63 | + rust: nightly |
| 64 | + env: TARGET=i686-unknown-linux-gnu |
| 65 | + addons: |
| 66 | + apt: |
| 67 | + packages: *i686_unknown_linux_gnu |
| 68 | + - os: linux |
| 69 | + rust: nightly |
| 70 | + env: TARGET=x86_64-unknown-linux-gnu |
| 71 | + |
| 72 | +before_install: |
| 73 | + - | |
| 74 | + export PATH="$PATH:$HOME/.cargo/bin" |
| 75 | + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then |
| 76 | + brew update && |
| 77 | + brew install freetype |
| 78 | + fi |
| 79 | +
|
5 | 80 | install: |
6 | | - - sudo apt-get update |
7 | | - - sudo apt-get install gcc g++ make upx electric-fence libsdl1.2-dev mercurial |
| 81 | + - bash ci/install.sh |
| 82 | + |
| 83 | +before_script: |
| 84 | + # load travis-cargo |
| 85 | + - | |
| 86 | + pip install 'travis-cargo<0.2' --user && |
| 87 | + if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then |
| 88 | + export PATH=$HOME/.local/bin/:$PATH |
| 89 | + else |
| 90 | + export PATH=$HOME/Library/Python/2.7/bin:$PATH |
| 91 | + fi |
| 92 | +
|
| 93 | +# the main build |
8 | 94 | script: |
9 | | - - cargo build -v |
| 95 | + - bash ci/script.sh |
| 96 | + |
| 97 | +after_success: |
| 98 | + # upload the documentation from the build with stable (automatically only |
| 99 | + # actually runs from the master branch, not individual PRs) |
| 100 | + - travis-cargo --only stable doc-upload |
| 101 | + # measure code coverage and upload to coveralls.io (the verify argument |
| 102 | + # mitigates kcov crashes due to malformed debuginfo, at the cost of some |
| 103 | + # speed. <https://github.com/huonw/travis-cargo/issues/12>) |
| 104 | + - travis-cargo coveralls --no-sudo --verify |
| 105 | + |
| 106 | +before_deploy: |
| 107 | + - bash ci/before_deploy.sh |
| 108 | + |
| 109 | +deploy: |
| 110 | + provider: releases |
| 111 | + api_key: |
| 112 | + # secure Github token for release upload |
| 113 | + secure: "OtcCEFBniy4i89KaFKEOct+JsTQF3W3+6SYWlcB4FEvljRwwpAMWzpqoHQhfNLPQiX07Da+IlKrhM5wt2PPF80dEzyIxiK6Y/fJFgd0peAkbKYwqrgoS80WoqSHYBR8STb+X6JlhxxX+/pma+ILBBFQ6UH01KEHGISlHq4ARw58=" |
| 114 | + file_glob: true |
| 115 | + file: ${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET}.* |
| 116 | + # don't delete the artifacts from previous phases |
| 117 | + skip_cleanup: true |
| 118 | + on: |
| 119 | + # channel to use to produce the release artifacts |
| 120 | + condition: $TRAVIS_RUST_VERSION = stable |
| 121 | + tags: true |
| 122 | + |
| 123 | +branches: |
| 124 | + only: |
| 125 | + - master |
| 126 | + - auto |
| 127 | + # Ruby regex to match tags. Required to Travis won't trigger deploys when a |
| 128 | + # new tag is pushed. This regex matches semantic versions like |
| 129 | + # v1.2.3-rc4+2016.02.22 |
| 130 | + - /^v\d+\.\d+\.\d+.*$/ |
| 131 | + |
| 132 | +notifications: |
| 133 | + email: |
| 134 | + on_success: never |
0 commit comments