SKIP test_keygen.sh on Windows until the underlying issue is resolved
[tor.git] / .travis.yml
blob6a3e1bfc01d60b48128859f832432a10772e9c5c
1 language: c
3 ## Comment out the compiler list for now to allow an explicit build
4 ## matrix.
5 # compiler:
6 #   - gcc
7 #   - clang
9 notifications:
10   irc:
11     channels:
12       - "irc.oftc.net#tor-ci"
13     template:
14       - "%{repository} %{branch} %{commit} - %{author}: %{commit_subject}"
15       - "Build #%{build_number} %{result}. Details: %{build_url}"
16     on_success: change
17     on_failure: change
18   email:
19     on_success: never
20     on_failure: change
22 os:
23   - linux
24   ## Uncomment the following line to also run the entire build matrix on OSX.
25   ## This will make your CI builds take roughly ten times longer to finish.
26   # - osx
28 ## Use the Ubuntu Trusty images.
29 dist: trusty
31 ## We don't need sudo. (The "apt:" stanza after this allows us to not need sudo;
32 ## otherwise, we would need it for getting dependencies.)
34 ## We override this in the explicit build matrix to work around a
35 ## Travis CI environment regression
36 ## https://github.com/travis-ci/travis-ci/issues/9033
37 sudo: false
39 ## (Linux only) Download our dependencies
40 addons:
41   apt:
42     packages:
43       ## Required dependencies
44       - libevent-dev
45       - libseccomp2
46       - zlib1g-dev
47       ## Optional dependencies
48       - liblzma-dev
49       - libscrypt-dev
50       ## zstd doesn't exist in Ubuntu Trusty
51       #- libzstd
53 ## The build matrix in the following two stanzas expands into four builds (per OS):
55 ##  * with GCC, with Rust
56 ##  * with GCC, without Rust
57 ##  * with Clang, with Rust
58 ##  * with Clang, without Rust
59 env:
60   global:
61     ## The Travis CI environment allows us two cores, so let's use both.
62     - MAKEFLAGS="-j 2"
64 matrix:
65   ## Uncomment to allow the build to report success (with non-required
66   ## sub-builds continuing to run) if all required sub-builds have
67   ## succeeded.  This is somewhat buggy currently: it can cause
68   ## duplicate notifications and prematurely report success if a
69   ## single sub-build has succeeded.  See
70   ## https://github.com/travis-ci/travis-ci/issues/1696
71   # fast_finish: true
73   ## Uncomment the appropriate lines below to allow the build to
74   ## report success even if some less-critical sub-builds fail and it
75   ## seems likely to take a while for someone to fix it.  Currently
76   ## Travis CI doesn't distinguish "all builds succeeded" from "some
77   ## non-required sub-builds failed" except on the individual build's
78   ## page, which makes it somewhat annoying to detect from the
79   ## branches and build history pages.  See
80   ## https://github.com/travis-ci/travis-ci/issues/8716
81   allow_failures:
82     # - env: RUST_OPTIONS="--enable-rust" TOR_RUST_DEPENDENCIES=true
83     # - env: RUST_OPTIONS="--enable-rust --enable-cargo-online-mode
84     # - compiler: clang
86   ## Create explicit matrix entries to work around a Travis CI
87   ## environment issue.  Missing keys inherit from the first list
88   ## entry under that key outside the "include" clause.
89   include:
90     - compiler: gcc
91     - compiler: gcc
92       env: COVERAGE_OPTIONS="--enable-coverage"
93     - compiler: gcc
94       env: DISTCHECK="yes"
95     ## The "sudo: required" forces non-containerized builds, working
96     ## around a Travis CI environment issue: clang LeakAnalyzer fails
97     ## because it requires ptrace and the containerized environment no
98     ## longer allows ptrace.
99     - compiler: clang
100       sudo: required
102 before_install:
103   ## If we're on OSX, homebrew usually needs to updated first
104   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
105   ## Download rustup
106   - curl -Ssf -o rustup.sh https://sh.rustup.rs
107   - if [[ "$COVERAGE_OPTIONS" != "" ]]; then pip install --user cpp-coveralls; fi
109 install:
110   ## If we're on OSX use brew to install required dependencies (for Linux, see the "apt:" section above)
111   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated openssl    || brew upgrade openssl;    }; fi
112   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated libevent   || brew upgrade libevent;   }; fi
113   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated pkg-config || brew upgrade pkg-config; }; fi
114   ## If we're on OSX also install the optional dependencies
115   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated xz         || brew upgrade xz;         }; fi
116   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated libscrypt  || brew upgrade libscrypt;  }; fi
117   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated zstd       || brew upgrade zstd;       }; fi
119 script:
120   - ./autogen.sh
121   - ./configure $RUST_OPTIONS $COVERAGE_OPTIONS --disable-asciidoc --enable-fatal-warnings --disable-silent-rules --enable-fragile-hardening
122   ## We run `make check` because that's what https://jenkins.torproject.org does.
123   - if [[ "$DISTCHECK" == "" ]]; then make check; fi
124   - if [[ "$DISTCHECK" != "" ]]; then make distcheck DISTCHECK_CONFIGURE_FLAGS="$RUST_OPTIONS $COVERAGE_OPTIONS --disable-asciidoc --enable-fatal-warnings --disable-silent-rules --enable-fragile-hardening"; fi
126 after_failure:
127   ## `make check` will leave a log file with more details of test failures.
128   - if [[ "$DISTCHECK" == "" ]]; then cat test-suite.log; fi
129   ## `make distcheck` puts it somewhere different.
130   - if [[ "$DISTCHECK" != "" ]]; then make show-distdir-testlog; fi
132 after_success:
133   ## If this build was one that produced coverage, upload it.
134   - if [[ "$COVERAGE_OPTIONS" != "" ]]; then coveralls -b . --exclude src/test --exclude src/trunnel --gcov-options '\-p'; fi