Merge remote-tracking branch 'sebastian/myfamily'
[tor/appveyor.git] / .travis.yml
blobd3918875dd647ef51fe30855803e1b4bb0327ec8
1 language: c
3 compiler:
4   - gcc
5   - clang
7 notifications:
8   irc:
9     channels:
10       - "irc.oftc.net#tor-ci"
11     template:
12       - "%{repository} %{branch} %{commit} - %{author}: %{commit_subject}"
13       - "Build #%{build_number} %{result}. Details: %{build_url}"
14     on_success: change
15     on_failure: change
16   email:
17     on_success: never
18     on_failure: change
20 os:
21   - linux
22   ## Uncomment the following line to also run the entire build matrix on OSX.
23   ## This will make your CI builds take roughly ten times longer to finish.
24   # - osx
26 ## Use the Ubuntu Trusty images.
27 dist: trusty
29 ## We don't need sudo. (The "apt:" stanza after this allows us to not need sudo;
30 ## otherwise, we would need it for getting dependencies.)
31 sudo: false
33 ## (Linux only) Download our dependencies
34 addons:
35   apt:
36     packages:
37       ## Required dependencies
38       - libevent-dev
39       - libseccomp2
40       - zlib1g-dev
41       ## Optional dependencies
42       - liblzma-dev
43       - libscrypt-dev
44       ## zstd doesn't exist in Ubuntu Trusty
45       #- libzstd
47 ## The build matrix in the following two stanzas expands into four builds (per OS):
49 ##  * with GCC, with Rust
50 ##  * with GCC, without Rust
51 ##  * with Clang, with Rust
52 ##  * with Clang, without Rust
53 env:
54   global:
55     ## The Travis CI environment allows us two cores, so let's use both.
56     - MAKEFLAGS="-j 2"
57   matrix:
58     - RUST_OPTIONS="--enable-rust --enable-cargo-online-mode"
59     - RUST_OPTIONS="--enable-rust" TOR_RUST_DEPENDENCIES=true
60     - RUST_OPTIONS=""
62 matrix:
63   ## If one build in the matrix fails (e.g. if building withour Rust and Clang
64   ## fails, but building with Rust and GCC is still going), then cancel the
65   ## entire job early and call the whole thing a failure.
66   fast_finish: true
68 before_install:
69   ## If we're on OSX, homebrew usually needs to updated first
70   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
71   ## Download rustup
72   - if [[ "$RUST_OPTIONS" != "" ]]; then curl -Ssf -o rustup.sh https://sh.rustup.rs; fi
74 install:
75   ## If we're on OSX use brew to install required dependencies (for Linux, see the "apt:" section above)
76   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated openssl    || brew upgrade openssl;    }; fi
77   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated libevent   || brew upgrade libevent;   }; fi
78   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated pkg-config || brew upgrade pkg-config; }; fi
79   ## If we're on OSX also install the optional dependencies
80   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated xz         || brew upgrade xz;         }; fi
81   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated libscrypt  || brew upgrade libscrypt;  }; fi
82   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated zstd       || brew upgrade zstd;       }; fi
83   ## Install the nightly channels of rustc and cargo and setup our toolchain environment
84   - if [[ "$RUST_OPTIONS" != "" ]]; then sh rustup.sh -y --default-toolchain nightly; fi
85   - if [[ "$RUST_OPTIONS" != "" ]]; then source $HOME/.cargo/env; fi
86   ## Get some info about rustc and cargo
87   - if [[ "$RUST_OPTIONS" != "" ]]; then which rustc; fi
88   - if [[ "$RUST_OPTIONS" != "" ]]; then which cargo; fi
89   - if [[ "$RUST_OPTIONS" != "" ]]; then rustc --version; fi
90   - if [[ "$RUST_OPTIONS" != "" ]]; then cargo --version; fi
91   ## If we're testing rust builds in offline-mode, then set up our vendored dependencies
92   - if [[ "$RUST_OPTIONS" == "--enable-rust" ]]; then git submodule init  ; fi
93   - if [[ "$RUST_OPTIONS" == "--enable-rust" ]]; then git submodule update; fi
94   - if [[ "$TOR_RUST_DEPENDENCIES" == "true" ]]; then export TOR_RUST_DEPENDENCIES=$PWD/src/ext/rust/crates; fi
96 script:
97   - ./autogen.sh
98   - ./configure $RUST_OPTIONS --disable-asciidoc --enable-fatal-warnings --disable-silent-rules --enable-fragile-hardening
99   ## We run `make check` because that's what https://jenkins.torproject.org does.
100   - make check
102 after_failure:
103   ## `make check` will leave a log file with more details of test failures.
104   - cat test-suite.log