Steve Dower | e5f41d2 | 2018-05-16 17:50:29 -0400 | [diff] [blame] | 1 | # Current docs for the syntax of this file are at: |
| 2 | # https://github.com/Microsoft/vsts-agent/blob/master/docs/preview/yamlgettingstarted.md |
| 3 | |
| 4 | name: $(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.rr) |
| 5 | |
| 6 | queue: |
| 7 | name: Hosted Linux Preview |
| 8 | |
| 9 | trigger: |
| 10 | branches: |
| 11 | include: |
| 12 | - master |
| 13 | - 3.7 |
| 14 | - 3.6 |
| 15 | paths: |
| 16 | exclude: |
| 17 | - Doc/* |
| 18 | - Tools/* |
| 19 | |
| 20 | variables: |
| 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 | |
| 25 | steps: |
| 26 | - checkout: self |
| 27 | clean: true |
| 28 | fetchDepth: 5 |
| 29 | |
Steve Dower | b221c93 | 2018-08-07 15:45:27 +0100 | [diff] [blame] | 30 | - 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 Dower | e5f41d2 | 2018-05-16 17:50:29 -0400 | [diff] [blame] | 41 | #- 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 Dower | b221c93 | 2018-08-07 15:45:27 +0100 | [diff] [blame] | 47 | condition: and(succeeded(), ne(variables['DocOnly'], 'true')) |
Steve Dower | e5f41d2 | 2018-05-16 17:50:29 -0400 | [diff] [blame] | 48 | |
| 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 Ware | 3f197f9 | 2018-06-24 10:20:34 -0500 | [diff] [blame] | 68 | xvfb |
Steve Dower | e5f41d2 | 2018-05-16 17:50:29 -0400 | [diff] [blame] | 69 | displayName: 'Install dependencies' |
Steve Dower | b221c93 | 2018-08-07 15:45:27 +0100 | [diff] [blame] | 70 | condition: and(succeeded(), ne(variables['DocOnly'], 'true')) |
Steve Dower | e5f41d2 | 2018-05-16 17:50:29 -0400 | [diff] [blame] | 71 | - script: python3 Tools/ssl/multissltests.py --steps=library --base-directory $(build.sourcesDirectory)/multissl --openssl $(OPENSSL) --system Linux |
| 72 | displayName: 'python multissltests.py' |
Steve Dower | b221c93 | 2018-08-07 15:45:27 +0100 | [diff] [blame] | 73 | condition: and(succeeded(), ne(variables['DocOnly'], 'true')) |
Steve Dower | e5f41d2 | 2018-05-16 17:50:29 -0400 | [diff] [blame] | 74 | |
| 75 | |
| 76 | - script: ./configure --with-pydebug |
| 77 | displayName: 'Configure CPython (debug)' |
Steve Dower | b221c93 | 2018-08-07 15:45:27 +0100 | [diff] [blame] | 78 | condition: and(succeeded(), ne(variables['DocOnly'], 'true')) |
Steve Dower | e5f41d2 | 2018-05-16 17:50:29 -0400 | [diff] [blame] | 79 | |
| 80 | - script: make -s -j4 |
| 81 | displayName: 'Build CPython' |
Steve Dower | b221c93 | 2018-08-07 15:45:27 +0100 | [diff] [blame] | 82 | condition: and(succeeded(), ne(variables['DocOnly'], 'true')) |
Steve Dower | e5f41d2 | 2018-05-16 17:50:29 -0400 | [diff] [blame] | 83 | |
| 84 | - script: ./python -m venv venv && ./venv/bin/python -m pip install -U coverage |
| 85 | displayName: 'Set up virtual environment' |
Steve Dower | b221c93 | 2018-08-07 15:45:27 +0100 | [diff] [blame] | 86 | condition: and(succeeded(), ne(variables['DocOnly'], 'true')) |
Steve Dower | e5f41d2 | 2018-05-16 17:50:29 -0400 | [diff] [blame] | 87 | |
| 88 | - script: ./venv/bin/python -m test.pythoninfo |
| 89 | displayName: 'Display build info' |
Steve Dower | b221c93 | 2018-08-07 15:45:27 +0100 | [diff] [blame] | 90 | condition: and(succeeded(), ne(variables['DocOnly'], 'true')) |
Steve Dower | e5f41d2 | 2018-05-16 17:50:29 -0400 | [diff] [blame] | 91 | |
Zachary Ware | 3f197f9 | 2018-06-24 10:20:34 -0500 | [diff] [blame] | 92 | - 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 Dower | e5f41d2 | 2018-05-16 17:50:29 -0400 | [diff] [blame] | 93 | displayName: 'Tests with coverage' |
Steve Dower | b221c93 | 2018-08-07 15:45:27 +0100 | [diff] [blame] | 94 | condition: and(succeeded(), ne(variables['DocOnly'], 'true')) |
Steve Dower | e5f41d2 | 2018-05-16 17:50:29 -0400 | [diff] [blame] | 95 | |
| 96 | - script: source ./venv/bin/activate && bash <(curl -s https://codecov.io/bash) |
| 97 | displayName: 'Publish code coverage results' |
Steve Dower | b221c93 | 2018-08-07 15:45:27 +0100 | [diff] [blame] | 98 | condition: and(succeeded(), ne(variables['DocOnly'], 'true')) |