blob: 1112555ab93f9b5ded6d72d539667c1ff4e73b13 [file] [log] [blame]
Steve Dowere5f41d22018-05-16 17:50:29 -04001# Current docs for the syntax of this file are at:
2# https://github.com/Microsoft/vsts-agent/blob/master/docs/preview/yamlgettingstarted.md
3
4name: $(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.rr)
5
6queue:
7 name: Hosted Linux Preview
8
9trigger:
10 branches:
11 include:
12 - master
13 - 3.7
14 - 3.6
15 paths:
16 exclude:
17 - Doc/*
18 - Tools/*
19
20variables:
21 # Copy-pasted from linux-deps.yml until template support arrives
22 OPENSSL: 1.1.0g
23 OPENSSL_DIR: "$(build.sourcesDirectory)/multissl/openssl/$(OPENSSL)"
24
25steps:
26- checkout: self
27 clean: true
28 fetchDepth: 5
29
Steve Dowerb221c932018-08-07 15:45:27 +010030- script: |
31 git fetch -q origin $(system.pullRequest.targetBranch)
32 if ! git diff --name-only HEAD $(git merge-base HEAD FETCH_HEAD) | grep -qvE '(\.rst$|^Doc|^Misc)'
33 then
34 echo "Only docs were updated, stopping build process."
35 echo "##vso[task.setvariable variable=DocOnly]true"
36 exit
37 fi
38 displayName: Detect doc-only changes
39 condition: and(succeeded(), variables['system.pullRequest.targetBranch'])
40
Steve Dowere5f41d22018-05-16 17:50:29 -040041#- template: linux-deps.yml
42
43# See https://github.com/Microsoft/vsts-agent/blob/master/docs/preview/yamlgettingstarted-templates.md
44# For now, we copy/paste the steps
45- script: echo "deb-src http://archive.ubuntu.com/ubuntu/ xenial main" > /etc/apt/sources.list.d/python.list && sudo apt-get update
46 displayName: 'Update apt-get lists'
Steve Dowerb221c932018-08-07 15:45:27 +010047 condition: and(succeeded(), ne(variables['DocOnly'], 'true'))
Steve Dowere5f41d22018-05-16 17:50:29 -040048
49- script: echo ##vso[task.prependpath]$(OPENSSL_DIR)
50 displayName: 'Add $(OPENSSL_DIR) to PATH'
51- script: >
52 sudo apt-get -yq install
53 build-essential
54 zlib1g-dev
55 libbz2-dev
56 liblzma-dev
57 libncurses5-dev
58 libreadline6-dev
59 libsqlite3-dev
60 libssl-dev
61 libgdbm-dev
62 tk-dev
63 lzma
64 lzma-dev
65 liblzma-dev
66 libffi-dev
67 uuid-dev
Zachary Ware3f197f92018-06-24 10:20:34 -050068 xvfb
Steve Dowere5f41d22018-05-16 17:50:29 -040069 displayName: 'Install dependencies'
Steve Dowerb221c932018-08-07 15:45:27 +010070 condition: and(succeeded(), ne(variables['DocOnly'], 'true'))
Steve Dowere5f41d22018-05-16 17:50:29 -040071- script: python3 Tools/ssl/multissltests.py --steps=library --base-directory $(build.sourcesDirectory)/multissl --openssl $(OPENSSL) --system Linux
72 displayName: 'python multissltests.py'
Steve Dowerb221c932018-08-07 15:45:27 +010073 condition: and(succeeded(), ne(variables['DocOnly'], 'true'))
Steve Dowere5f41d22018-05-16 17:50:29 -040074
75
76- script: ./configure --with-pydebug
77 displayName: 'Configure CPython (debug)'
Steve Dowerb221c932018-08-07 15:45:27 +010078 condition: and(succeeded(), ne(variables['DocOnly'], 'true'))
Steve Dowere5f41d22018-05-16 17:50:29 -040079
80- script: make -s -j4
81 displayName: 'Build CPython'
Steve Dowerb221c932018-08-07 15:45:27 +010082 condition: and(succeeded(), ne(variables['DocOnly'], 'true'))
Steve Dowere5f41d22018-05-16 17:50:29 -040083
84- script: ./python -m venv venv && ./venv/bin/python -m pip install -U coverage
85 displayName: 'Set up virtual environment'
Steve Dowerb221c932018-08-07 15:45:27 +010086 condition: and(succeeded(), ne(variables['DocOnly'], 'true'))
Steve Dowere5f41d22018-05-16 17:50:29 -040087
88- script: ./venv/bin/python -m test.pythoninfo
89 displayName: 'Display build info'
Steve Dowerb221c932018-08-07 15:45:27 +010090 condition: and(succeeded(), ne(variables['DocOnly'], 'true'))
Steve Dowere5f41d22018-05-16 17:50:29 -040091
Zachary Ware3f197f92018-06-24 10:20:34 -050092- script: xvfb-run ./venv/bin/python -m coverage run --pylib -m test --fail-env-changed -uall,-cpu -x test_multiprocessing_fork -x test_multiprocessing_forkserver -x test_multiprocessing_spawn -x test_concurrent_futures
Steve Dowere5f41d22018-05-16 17:50:29 -040093 displayName: 'Tests with coverage'
Steve Dowerb221c932018-08-07 15:45:27 +010094 condition: and(succeeded(), ne(variables['DocOnly'], 'true'))
Steve Dowere5f41d22018-05-16 17:50:29 -040095
96- script: source ./venv/bin/activate && bash <(curl -s https://codecov.io/bash)
97 displayName: 'Publish code coverage results'
Steve Dowerb221c932018-08-07 15:45:27 +010098 condition: and(succeeded(), ne(variables['DocOnly'], 'true'))