|
3 | 3 | # Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
|
4 | 4 | # https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/python?view=azure-devops
|
5 | 5 |
|
6 |
| -strategy: |
7 |
| -matrix: |
8 |
| -Linux_py37: |
9 |
| -vmImage:'ubuntu-18.04' |
10 |
| -python.version:'3.7' |
11 |
| -Linux_py38: |
12 |
| -vmImage:'ubuntu-18.04' |
13 |
| -python.version:'3.8' |
14 |
| -Linux_py39: |
15 |
| -vmImage:'ubuntu-18.04' |
16 |
| -python.version:'3.9' |
17 |
| -macOS_py37: |
18 |
| -vmImage:'macOS-10.15' |
19 |
| -python.version:'3.7' |
20 |
| -macOS_py38: |
21 |
| -vmImage:'macOS-latest' |
22 |
| -python.version:'3.8' |
23 |
| -macOS_py39: |
24 |
| -vmImage:'macOS-latest' |
25 |
| -python.version:'3.9' |
26 |
| -Windows_py37: |
27 |
| -vmImage:'vs2017-win2016' |
28 |
| -python.version:'3.7' |
29 |
| -Windows_py38: |
30 |
| -vmImage:'windows-latest' |
31 |
| -python.version:'3.8' |
32 |
| -Windows_py39: |
33 |
| -vmImage:'windows-latest' |
34 |
| -python.version:'3.9' |
35 |
| -maxParallel:4 |
| 6 | +stages: |
36 | 7 |
|
37 |
| -pool: |
38 |
| -vmImage:'$(vmImage)' |
39 |
| - |
40 |
| -steps: |
| 8 | +-stage:Check |
| 9 | +jobs: |
| 10 | + -job:Skip |
| 11 | +pool: |
| 12 | +vmImage:'ubuntu-18.04' |
| 13 | +variables: |
| 14 | +DECODE_PERCENTS:'false' |
| 15 | +RET:'true' |
| 16 | +steps: |
| 17 | + -bash:| |
| 18 | + git_log=`git log --max-count=1 --skip=1 --pretty=format:"%B" | tr "\n" " "` |
| 19 | + echo "##vso[task.setvariable variable=log]$git_log" |
| 20 | + -bash:echo "##vso[task.setvariable variable=RET]false" |
| 21 | +condition:or(contains(variables.log, '[skip azp]'), contains(variables.log, '[azp skip]'), contains(variables.log, '[skip ci]'), contains(variables.log, '[ci skip]')) |
| 22 | + -bash:echo "##vso[task.setvariable variable=start_main;isOutput=true]$RET" |
| 23 | +name:result |
41 | 24 |
|
42 |
| --task:UsePythonVersion@0 |
43 |
| -inputs: |
44 |
| -versionSpec:'$(python.version)' |
45 |
| -architecture:'x64' |
46 |
| -displayName:'Use Python $(python.version)' |
47 |
| -condition:and(succeeded(), ne(variables['python.version'], 'Pre')) |
| 25 | +-stage:Main |
| 26 | +condition:and(succeeded(), eq(dependencies.Check.outputs['Skip.result.start_main'], 'true')) |
| 27 | +dependsOn:Check |
| 28 | +jobs: |
| 29 | + -job:Pytest |
| 30 | +strategy: |
| 31 | +matrix: |
| 32 | +Linux_py37: |
| 33 | +vmImage:'ubuntu-18.04' |
| 34 | +python.version:'3.7' |
| 35 | +Linux_py38: |
| 36 | +vmImage:'ubuntu-18.04' |
| 37 | +python.version:'3.8' |
| 38 | +Linux_py39: |
| 39 | +vmImage:'ubuntu-18.04' |
| 40 | +python.version:'3.9' |
| 41 | +macOS_py37: |
| 42 | +vmImage:'macOS-10.15' |
| 43 | +python.version:'3.7' |
| 44 | +macOS_py38: |
| 45 | +vmImage:'macOS-latest' |
| 46 | +python.version:'3.8' |
| 47 | +macOS_py39: |
| 48 | +vmImage:'macOS-latest' |
| 49 | +python.version:'3.9' |
| 50 | +Windows_py37: |
| 51 | +vmImage:'vs2017-win2016' |
| 52 | +python.version:'3.7' |
| 53 | +Windows_py38: |
| 54 | +vmImage:'windows-latest' |
| 55 | +python.version:'3.8' |
| 56 | +Windows_py39: |
| 57 | +vmImage:'windows-latest' |
| 58 | +python.version:'3.9' |
| 59 | +maxParallel:4 |
| 60 | +pool: |
| 61 | +vmImage:'$(vmImage)' |
| 62 | +steps: |
| 63 | + -task:UsePythonVersion@0 |
| 64 | +inputs: |
| 65 | +versionSpec:'$(python.version)' |
| 66 | +architecture:'x64' |
| 67 | +displayName:'Use Python $(python.version)' |
| 68 | +condition:and(succeeded(), ne(variables['python.version'], 'Pre')) |
48 | 69 |
|
49 |
| --task:stevedower.python.InstallPython.InstallPython@1 |
50 |
| -displayName:'Use prerelease Python' |
51 |
| -inputs: |
52 |
| -prerelease:true |
53 |
| -condition:and(succeeded(), eq(variables['python.version'], 'Pre')) |
| 70 | +-task:stevedower.python.InstallPython.InstallPython@1 |
| 71 | +displayName:'Use prerelease Python' |
| 72 | +inputs: |
| 73 | +prerelease:true |
| 74 | +condition:and(succeeded(), eq(variables['python.version'], 'Pre')) |
54 | 75 |
|
55 |
| --bash:| |
56 |
| - set -e |
57 |
| - case "$(python -c 'import sys; print(sys.platform)')" in |
58 |
| - linux) |
59 |
| - sudo apt update |
60 |
| - sudo apt install \ |
61 |
| - cm-super \ |
62 |
| - dvipng \ |
63 |
| - ffmpeg \ |
64 |
| - gdb \ |
65 |
| - gir1.2-gtk-3.0 \ |
66 |
| - graphviz \ |
67 |
| - inkscape \ |
68 |
| - libcairo2 \ |
69 |
| - libgirepository-1.0.1 \ |
70 |
| - lmodern \ |
71 |
| - fonts-freefont-otf \ |
72 |
| - poppler-utils \ |
73 |
| - texlive-pictures \ |
74 |
| - texlive-fonts-recommended \ |
75 |
| - texlive-latex-base \ |
76 |
| - texlive-latex-extra \ |
77 |
| - texlive-latex-recommended \ |
78 |
| - texlive-xetex texlive-luatex \ |
79 |
| - ttf-wqy-zenhei |
80 |
| - ;; |
81 |
| - darwin) |
82 |
| - brew install --cask xquartz |
83 |
| - brew install pkg-config ffmpeg imagemagick mplayer ccache |
84 |
| - ;; |
85 |
| - win32) |
86 |
| - ;; |
87 |
| - *) |
88 |
| - exit 1 |
89 |
| - ;; |
90 |
| - esac |
91 |
| -displayName:'Install dependencies' |
| 76 | +-bash:| |
| 77 | +set -e |
| 78 | +case "$(python -c 'import sys; print(sys.platform)')" in |
| 79 | +linux) |
| 80 | +sudo apt update |
| 81 | +sudo apt install \ |
| 82 | +cm-super \ |
| 83 | +dvipng \ |
| 84 | +ffmpeg \ |
| 85 | +gdb \ |
| 86 | +gir1.2-gtk-3.0 \ |
| 87 | +graphviz \ |
| 88 | +inkscape \ |
| 89 | +libcairo2 \ |
| 90 | +libgirepository-1.0.1 \ |
| 91 | +lmodern \ |
| 92 | +fonts-freefont-otf \ |
| 93 | +poppler-utils \ |
| 94 | +texlive-pictures \ |
| 95 | +texlive-fonts-recommended \ |
| 96 | +texlive-latex-base \ |
| 97 | +texlive-latex-extra \ |
| 98 | +texlive-latex-recommended \ |
| 99 | +texlive-xetex texlive-luatex \ |
| 100 | +ttf-wqy-zenhei |
| 101 | +;; |
| 102 | +darwin) |
| 103 | +brew install --cask xquartz |
| 104 | +brew install pkg-config ffmpeg imagemagick mplayer ccache |
| 105 | +;; |
| 106 | +win32) |
| 107 | +;; |
| 108 | +*) |
| 109 | +exit 1 |
| 110 | +;; |
| 111 | +esac |
| 112 | +displayName: 'Install dependencies' |
92 | 113 |
|
93 |
| --bash:| |
94 |
| - python -m pip install --upgrade pip |
95 |
| - python -m pip install -r requirements/testing/all.txt -r requirements/testing/extra.txt || |
96 |
| - [[ "$PYTHON_VERSION" = 'Pre' ]] |
97 |
| -displayName:'Install dependencies with pip' |
| 114 | +-bash:| |
| 115 | +python -m pip install --upgrade pip |
| 116 | +python -m pip install -r requirements/testing/all.txt -r requirements/testing/extra.txt || |
| 117 | +[[ "$PYTHON_VERSION" = 'Pre' ]] |
| 118 | +displayName: 'Install dependencies with pip' |
98 | 119 |
|
99 |
| --bash:| |
100 |
| - python -m pip install -ve . || |
101 |
| - [[ "$PYTHON_VERSION" = 'Pre' ]] |
102 |
| -displayName:"Install self" |
| 120 | +-bash:| |
| 121 | +python -m pip install -ve . || |
| 122 | +[[ "$PYTHON_VERSION" = 'Pre' ]] |
| 123 | +displayName: "Install self" |
103 | 124 |
|
104 |
| --script:env |
105 |
| -displayName:'print env' |
| 125 | +-script:env |
| 126 | +displayName:'print env' |
106 | 127 |
|
107 |
| --bash:| |
108 |
| - PYTHONFAULTHANDLER=1 python -m pytest --junitxml=junit/test-results.xml -raR --maxfail=50 --timeout=300 --durations=25 --cov-report= --cov=lib -n 2 || |
109 |
| - [[ "$PYTHON_VERSION" = 'Pre' ]] |
110 |
| -displayName:'pytest' |
| 128 | +-bash:| |
| 129 | +PYTHONFAULTHANDLER=1 python -m pytest --junitxml=junit/test-results.xml -raR --maxfail=50 --timeout=300 --durations=25 --cov-report= --cov=lib -n 2 || |
| 130 | +[[ "$PYTHON_VERSION" = 'Pre' ]] |
| 131 | +displayName: 'pytest' |
111 | 132 |
|
112 |
| --bash:| |
113 |
| - bash <(curl -s https://codecov.io/bash) -f "!*.gcov" -X gcov |
114 |
| -displayName:'Upload to codecov.io' |
| 133 | +-bash:| |
| 134 | +bash <(curl -s https://codecov.io/bash) -f "!*.gcov" -X gcov |
| 135 | +displayName: 'Upload to codecov.io' |
115 | 136 |
|
116 |
| --task:PublishTestResults@2 |
117 |
| -inputs: |
118 |
| -testResultsFiles:'**/test-results.xml' |
119 |
| -testRunTitle:'Python $(python.version)' |
120 |
| -condition:succeededOrFailed() |
| 137 | +-task:PublishTestResults@2 |
| 138 | +inputs: |
| 139 | +testResultsFiles:'**/test-results.xml' |
| 140 | +testRunTitle:'Python $(python.version)' |
| 141 | +condition:succeededOrFailed() |
121 | 142 |
|
122 |
| --publish:$(System.DefaultWorkingDirectory)/result_images |
123 |
| -artifact:$(Agent.JobName)-result_images |
124 |
| -condition:and(failed(), ne(variables['python.version'], 'Pre')) |
| 143 | +-publish:$(System.DefaultWorkingDirectory)/result_images |
| 144 | +artifact:$(Agent.JobName)-result_images |
| 145 | +condition:and(failed(), ne(variables['python.version'], 'Pre')) |