• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1language: c
2dist: bionic
3
4# To cache doc-building dependencies and C compiler output.
5cache:
6  - pip
7  - ccache
8  - directories:
9    - $HOME/multissl
10
11env:
12  global:
13    - OPENSSL=1.1.1k
14    - OPENSSL_DIR="$HOME/multissl/openssl/${OPENSSL}"
15    - PATH="${OPENSSL_DIR}/bin:$PATH"
16    - CFLAGS="-I${OPENSSL_DIR}/include"
17    - LDFLAGS="-L${OPENSSL_DIR}/lib"
18    # Set rpath with env var instead of -Wl,-rpath linker flag
19    # OpenSSL ignores LDFLAGS when linking bin/openssl
20    - LD_RUN_PATH="${OPENSSL_DIR}/lib"
21    - PYTHONSTRICTEXTENSIONBUILD=1
22
23branches:
24  only:
25    - master
26    - /^\d\.\d+$/
27    - buildbot-custom
28
29matrix:
30  fast_finish: true
31  allow_failures:
32    - env: OPTIONAL=true
33  include:
34    - name: "CPython tests"
35      os: linux
36      language: c
37      compiler: clang
38      # gcc also works, but to keep the # of concurrent builds down, we use one C
39      # compiler here and the other to run the coverage build. Clang is preferred
40      # in this instance for its better error messages.
41      env: TESTING=cpython
42      addons:
43        apt:
44          packages:
45            - gdb
46            - xvfb
47    - name: "Documentation build"
48      os: linux
49      language: python
50      # Build the docs against a stable version of Python so code bugs don't hold up doc-related PRs.
51      python: 3.6
52      env: TESTING=docs
53      before_script:
54        - cd Doc
55        - make venv PYTHON=python
56      script:
57        - make check html suspicious SPHINXOPTS="-q -W -j4"
58    - name: "Documentation tests"
59      os: linux
60      language: c
61      compiler: clang
62      env: TESTING=doctest
63      addons:
64        apt:
65          packages:
66            - xvfb
67      before_script:
68        - ./configure
69        - make -j4
70        - make -C Doc/ PYTHON=../python venv
71      script:
72        xvfb-run make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W -j4" doctest
73
74
75before_install:
76  - set -e
77  - |
78      # Check short-circuit conditions
79      if [[ "${TESTING}" != "docs" && "${TESTING}" != "doctest" ]]
80      then
81        if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]
82        then
83          echo "Not a PR, doing full build."
84        else
85          # Pull requests are slightly complicated because $TRAVIS_COMMIT_RANGE
86          # may include more changes than desired if the history is convoluted.
87          # Instead, explicitly fetch the base branch and compare against the
88          # merge-base commit.
89          git fetch -q origin +refs/heads/$TRAVIS_BRANCH
90          changes=$(git diff --name-only HEAD $(git merge-base HEAD FETCH_HEAD))
91          echo "Files changed:"
92          echo "$changes"
93          if ! echo "$changes" | grep -qvE '(\.rst$)|(^Doc)|(^Misc)'
94          then
95            echo "Only docs were updated, stopping build process."
96            exit
97          fi
98        fi
99      fi
100
101install:
102  - |
103      # Install OpenSSL as necessary
104      # Note: doctest needs OpenSSL
105      if [[ "${TESTING}" != "docs" ]]
106      then
107        # clang complains about unused-parameter a lot, redirect stderr
108        python3 Tools/ssl/multissltests.py --steps=library \
109            --base-directory ${HOME}/multissl \
110            --openssl ${OPENSSL} >/dev/null 2>&1
111      fi
112  - openssl version
113
114# Travis provides only 2 cores, so don't overdo the parallelism and waste memory.
115before_script:
116  # -Og is much faster than -O0
117  - CFLAGS="${CFLAGS} -Og" ./configure --with-pydebug
118  - eval "$(pyenv init -)"
119  - pyenv global 3.8
120  - PYTHON_FOR_REGEN=python3.8 make -j4 regen-all
121  - make regen-stdlib-module-names
122  - changes=`git status --porcelain`
123  - |
124      # Check for changes in regenerated files
125      if ! test -z "$changes"
126      then
127        echo "Generated files not up to date"
128        echo "$changes"
129        exit 1
130      fi
131  - make -j4
132  - make pythoninfo
133
134script:
135  # Using the built Python as patchcheck.py is built around the idea of using
136  # a checkout-build of CPython to know things like what base branch the changes
137  # should be compared against.
138  # Only run on Linux as the check only needs to be run once.
139  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./python Tools/scripts/patchcheck.py --travis $TRAVIS_PULL_REQUEST; fi
140  # Check that all symbols exported by libpython start with "Py" or "_Py"
141  - make smelly
142  # Check that all symbols in the limited abi are present
143  - make check-limited-abi
144  # `-r -w` implicitly provided through `make buildbottest`.
145  - |
146    if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
147      XVFB_RUN=xvfb-run;
148    fi
149    $XVFB_RUN make buildbottest TESTOPTS="-j4 -uall,-cpu"
150notifications:
151  email: false
152  irc:
153    channels:
154      # This is set to a secure variable to prevent forks from notifying the
155      # IRC channel whenever they fail a build. This can be removed when travis
156      # implements https://github.com/travis-ci/travis-ci/issues/1094.
157      # The actual value here is: irc.freenode.net#python-dev
158      - secure: "s7kAkpcom2yUJ8XqyjFI0obJmhAGrn1xmoivdaPdgBIA++X47TBp1x4pgDsbEsoalef7bEwa4l07KdT4qa+DOd/c4QxaWom7fbN3BuLVsZuVfODnl79+gYq/TAbGfyH+yDs18DXrUfPgwD7C5aW32ugsqAOd4iWzfGJQ5OrOZzqzGjYdYQUEkJFXgxDEIb4aHvxNDWGO3Po9uKISrhb5saQ0l776yLo1Ur7M4oxl8RTbCdgX0vf5TzPg52BgvZpOgt3DHOUYPeiJLKNjAE6ibg0U95sEvMfHX77nz4aFY4/3UI6FFaRla34rZ+mYKrn0TdxOhera1QOgPmM6HzdO4K44FpfK1DS0Xxk9U9/uApq+cG0bU3W+cVUHDBe5+90lpRBAXHeHCgT7TI8gec614aiT8lEr3+yH8OBRYGzkjNK8E2LJZ/SxnVxDe7aLF6AWcoWLfS6/ziAIBFQ5Nc4U72CT8fGVSkl8ywPiRlvixKdvTODMSZo0jMqlfZSNaAPTsNRx4wu5Uis4qekwe32Fz4aB6KGpsuuVjBi+H6v0RKxNJNGY3JKDiEH2TK0UE2auJ5GvLW48aUVFcQMB7euCWYXlSWVRHh3WLU8QXF29Dw4JduRZqUpOdRgMHU79UHRq+mkE0jAS/nBcS6CvsmxCpTSrfVYuMOu32yt18QQoTyU="
159    on_success: change
160    on_failure: always
161    skip_join: true
162  webhooks:
163    urls:
164      # For the same reasons as above for IRC, we encrypt the webhook address
165      # for Zulip.  The actual value is:
166      # https://python.zulipchat.com/api/v1/external/travis?api_key=<api-key-redacted>&stream=core%2Ftest+runs
167      - secure: "vLz2TodSL7wQ8DsIu86koRS9i4dsK40PH8+wzY93PBCCAzJAz113LTxK3/9PamMv+ObDRUSe5OpXcquE3d5Gwpu8IymF113qK0I3uNr+O3FtmKlj/Kd1P/V+z4pTpS3zh3lW9gyKV9EMWXIWS0IYKKZQU144XqUlIiucWK2jHJF/cSz2cRAx/6Kx68X4mZwEC7hiMOF4ZsWUMbCglM89ybeS0pr0kK9mmh88qsPyRQov3mRKswmVPlePk7clVLNAL43qSe3SzmrmACZfQ9KJYmpYnr/cjo2b6svYHcQBAwAUarZZ9KBMXeV7HwGWsSXAvHH2ynR0P++braBHGEMTGMSitdVWzFTmeiHnrkp08WAB+uFs54iEx3VklTk9bCzozTm2S94TRxbrsG9SypMvQxG570JV6P2XYuR+taCb/GMtMqrtGQm2e1Ht+nDLtiUb+/+rwEbicJJ13knptOQZI4tPOZESI/kXkORkSNwFfLSNLSl9jTlMmO7KjAAPApURHEdx26RbItAn8mIX2NcHTRjKn2qV4h3C54nmHmKWn/ZudHHJc6ieZSEUBoaLGAYmcWJRqrM6jiy2h9I9TRrCKAiGh5jT47FYKLwosTtV245l/ZhDb6eTVfEFT6TSLEoyfx9cCtTUvfMtXYl8eN9wlFYYpH8MSWbMD14eEkKBTWg="
168    on_success: change
169    on_failure: always
170