-
-
Notifications
You must be signed in to change notification settings - Fork 187
/
azure-pipelines.yml
188 lines (163 loc) · 5.36 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
trigger:
branches:
include:
- '*'
- refs/tags/*
variables:
System.Debug: true
jobs:
- job: Lint
pool:
vmImage: ubuntu-16.04
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
architecture: 'x64'
- script: |
pip install pre-commit
pre-commit install-hooks
pre-commit run --all-files
- job: Windows
dependsOn: Lint
condition: succeeded()
timeoutInMinutes: 60
pool:
vmImage: vs2017-win2016
variables:
MSYSTEM: MINGW64
MSYS2_ARCH: x86_64
steps:
- script: |
choco install msys2 --params="/InstallDir:%CD:~0,2%\msys64 /NoUpdate /NoPath"
set PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
%CD:~0,2%\msys64\usr\bin\pacman --noconfirm -Syyuu
%CD:~0,2%\msys64\usr\bin\pacman --noconfirm -Syuu
displayName: Install MSYS2
- script: |
set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
%CD:~0,2%\msys64\usr\bin\bash -lc ".azure/msys2-install.sh"
displayName: Install Dependencies
env:
MSYS2_ARCH: $(MSYS2_ARCH)
MSYSTEM: $(MSYSTEM)
CHERE_INVOKING: yes
- script: |
set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
%CD:~0,2%\msys64\usr\bin\bash -lc ".azure/msys2-test.sh"
displayName: Run Tests
env:
MSYSTEM: $(MSYSTEM)
CHERE_INVOKING: yes
PY_IGNORE_IMPORTMISMATCH: yes
- task: PublishTestResults@2
condition: not(canceled())
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: Publish Test Results
- script: |
set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
%CD:~0,2%\msys64\usr\bin\bash -lc "win-installer/build-installer.sh"
displayName: Create Windows Binaries
condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'))
env:
MSYSTEM: $(MSYSTEM)
CHERE_INVOKING: yes
- task: CopyFiles@2
displayName: Copy Windows Binaries
condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'))
inputs:
sourceFolder: 'win-installer'
contents: '*.exe'
targetFolder: $(Build.ArtifactStagingDirectory)
- task: GitHubRelease@0
condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'))
displayName: Create GitHub Release
inputs:
gitHubConnection: GaphorConnection
repositoryName: gaphor/gaphor
action: create
tagSource: auto
target: $(Build.SourceVersion)
assets: $(Build.ArtifactStagingDirectory)/*.exe
isDraft: true
- job: macOS
dependsOn: Lint
condition: succeeded()
pool:
vmImage: 'macOS-10.13'
timeoutInMinutes: 60
variables:
PKG_CONFIG_PATH: /usr/local/Cellar/libffi/3.2.1/lib/pkgconfig:${PKG_CONFIG_PATH:-}
steps:
- script: |
brew install gobject-introspection gtk+3 adwaita-icon-theme
source venv
pip install pytest-xvfb
displayName: 'Install dependencies'
- script: |
source venv
pytest
displayName: 'PyTest'
env:
PYTEST_ADDOPTS: "--doctest-modules --junitxml=junit/test-results.xml"
- script: |
cd macos-dmg
./package.sh
displayName: Create macOS Package
- task: CopyFiles@2
displayName: Copy macOS Package
inputs:
sourceFolder: macos-dmg
contents: '*.dmg'
targetFolder: $(Build.ArtifactStagingDirectory)
- task: GitHubRelease@0
condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'))
displayName: Create GitHub Release
inputs:
gitHubConnection: GaphorConnection
repositoryName: gaphor/gaphor
action: create
tagSource: auto
target: $(Build.SourceVersion)
assets: $(Build.ArtifactStagingDirectory)/*.dmg
isDraft: true
- job: Linux
dependsOn: Lint
condition: succeeded()
pool:
vmImage: 'ubuntu-16.04'
timeoutInMinutes: 60
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
architecture: 'x64'
- script: >
sudo apt-get update -q && sudo apt-get install --no-install-recommends -y
python3-dev python3-gi python3-gi-cairo gir1.2-gtk-3.0 libgirepository1.0-dev libcairo2-dev
displayName: Install Ubuntu Dependencies
- script: |
source venv
displayName: Install Python Dependencies
- script: |
source venv
xvfb-run pytest
displayName: 'PyTest'
env:
PYTEST_ADDOPTS: "--doctest-modules --junitxml=junit/test-results.xml"
- task: PublishTestResults@2
condition: not(canceled())
inputs:
testResultsFiles: junit/test-results.xml
testRunTitle: Publish Test Results
- script: |
source venv
poetry build
displayName: Build Wheel
- script: |
poetry config repositories.azure https://pkgs.dev.azure.com/gaphor-dev/_packaging/PyPI-Feed/pypi/upload
poetry config http-basic.azure $(username) $(password)
poetry publish -r azure
exit 0
displayName: Publish software