This repository has been archived by the owner on Nov 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
azure-pipelines.yml
284 lines (273 loc) · 8.54 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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
trigger:
branches:
exclude:
# main branch publishes releases - avoid merges triggering a new release
- main
schedules:
- cron: "0 4 * * *"
displayName: Nightly build at 0400 UTC
branches:
include:
- main
always: true
variables:
- name: INSTALL_DEPS
value: "1"
- name: CLEAN_AFTER_BUILD
value: "1"
- name: STRIP_SYMBOLS
value: "1"
- name: COMPILE_DFU_UTIL
value: "1"
- name: COMPILE_YOSYS
value: "1"
- name: COMPILE_SBY
value: "1"
- name: COMPILE_Z3
value: "1"
- name: COMPILE_BOOLECTOR
value: "1"
- name: COMPILE_AVY
value: "0" # deliberately disabled
- name: COMPILE_YICES2
value: "1"
- name: COMPILE_ICESTORM
value: "1"
- name: COMPILE_NEXTPNR_ICE40
value: "1"
- name: COMPILE_NEXTPNR_ECP5
value: "1"
- name: COMPILE_ECPPROG
value: "1"
- name: COMPILE_OPENFPGALOADER
value: "1"
- name: COMPILE_IVERILOG
value: "0" # deliberately disabled
- name: COMPILE_GHDL
value: "1"
- name: BUNDLE_PYTHON
value: "1"
- name: BUNDLE_MAKE
value: "1"
- name: CREATE_PACKAGE
value: "1"
- name: TEST_BINARIES_EXECUTE
value: "1"
- name: TEST_ICE40_BLINKY
value: "1"
- name: TEST_ECP5_BLINKY
value: "1"
- name: TEST_NMIGEN
value: "1"
- name: TEST_GHDL_YOSYS
value: "1"
- name: TEST_NEXTPNR_PYTHON
value: "1"
- name: TEST_SBY
value: "1"
stages:
- stage: build_bba
displayName: Build ECP5 chipdb (*.bba)
condition: eq(variables['COMPILE_NEXTPNR_ECP5'], '1')
jobs:
- job: build_bba
displayName: Build ECP5 chipdb (*.bba)
pool:
vmImage: 'ubuntu-18.04'
steps:
- bash: ./build_bba.sh
displayName: Build ECP5 chipdb (*.bba)
name: build_bba
- publish: _packages/build_linux_x86_64/ecp5-bba-noarch-nightly.tar.gz
artifact: ecp5-bba
- stage: build_toolchain
displayName: build toolchain
condition: always()
jobs:
- job: build_toolchain
displayName: Build toolchain
timeoutInMinutes: 0
strategy:
matrix:
linux_x86_64:
ARCH: linux_x86_64
vm_image: ubuntu-16.04
container_image: ubuntu:20.04
pool:
vmImage: '$(vm_image)'
container:
image: $[ variables['container_image'] ]
options: "--name ci-container -v /usr/bin/docker:/tmp/docker:ro"
steps:
- task: DownloadPipelineArtifact@2
condition: eq(variables['COMPILE_NEXTPNR_ECP5'], '1')
inputs:
source: current
artifact: ecp5-bba
path: '$(Build.Repository.LocalPath)/_packages/build_linux_x86_64'
- bash: |
RELEASE_TAG=nightly-$(date +'%Y%m%d')
# create pipeline variable
echo "##vso[task.setvariable variable=RELEASE_TAG]$RELEASE_TAG"
- script: |
/tmp/docker exec -t -u 0 ci-container \
sh -c "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" -y install sudo"
displayName: Set up sudo
- bash: ./build.sh $(ARCH)
displayName: Build toolchain
name: build_toolchain
- publish: _packages/build_$(ARCH)/publish
artifact: fpga-toolchain-$(ARCH)-$(RELEASE_TAG)
- publish: _packages/build_$(ARCH)/publish_symbols
artifact: symbols_fpga-toolchain-$(ARCH)-$(RELEASE_TAG)
- job: build_toolchain_osx
displayName: Build toolchain OS X
timeoutInMinutes: 0
strategy:
matrix:
osx:
ARCH: darwin
vm_image: macOS-10.15
pool:
vmImage: '$(vm_image)'
steps:
- task: DownloadPipelineArtifact@2
condition: eq(variables['COMPILE_NEXTPNR_ECP5'], '1')
inputs:
source: current
artifact: ecp5-bba
path: '$(Build.Repository.LocalPath)/_packages/build_linux_x86_64'
- bash: |
RELEASE_TAG=nightly-$(date +'%Y%m%d')
# create pipeline variable
echo "##vso[task.setvariable variable=RELEASE_TAG]$RELEASE_TAG"
- bash: ./build.sh $(ARCH)
displayName: Build toolchain
name: build_toolchain
- publish: _packages/build_$(ARCH)/publish
artifact: fpga-toolchain-$(ARCH)-$(RELEASE_TAG)
- publish: _packages/build_$(ARCH)/publish_symbols
artifact: symbols_fpga-toolchain-$(ARCH)-$(RELEASE_TAG)
- job: build_toolchain_windows_amd64
displayName: Build toolchain windows_amd64
timeoutInMinutes: 0
pool:
vmImage: vs2017-win2016
variables:
ARCH: windows_amd64
MINGW_ARCH: x86_64
steps:
- powershell: |
Set-MpPreference -DisableArchiveScanning $true
Set-MpPreference -DisableRealtimeMonitoring $true
Set-MpPreference -DisableBehaviorMonitoring $true
- task: DownloadPipelineArtifact@2
condition: eq(variables['COMPILE_NEXTPNR_ECP5'], '1')
inputs:
source: current
artifact: ecp5-bba
path: '$(Build.Repository.LocalPath)/_packages/build_linux_x86_64'
- bash: |
RELEASE_TAG=nightly-$(date +'%Y%m%d')
# create pipeline variable
echo "##vso[task.setvariable variable=RELEASE_TAG]$RELEASE_TAG"
- script: |
set MSYS_ROOT=%CD:~0,2%\msys64
echo ##vso[task.setvariable variable=MSYS_ROOT]%MSYS_ROOT%
choco install msys2 --params "/NoUpdate /InstallDir:%MSYS_ROOT%"
displayName: Install MSYS2
- script: |
set PATH=%MSYS_ROOT%\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
%MSYS_ROOT%\usr\bin\pacman --noconfirm -Syyuu
displayName: Update MSYS2
- script: |
set PATH=%MSYS_ROOT%\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
%MSYS_ROOT%\usr\bin\pacman --noconfirm --needed -S git base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake
%MSYS_ROOT%\usr\bin\pacman --noconfirm -Scc
displayName: Install Toolchain
- script: |
set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
%MSYS_ROOT%\usr\bin\sed -i "s|#CacheDir.*|CacheDir=/c/Users/%USERNAME%/AppData/Local/Temp|g" /etc/pacman.conf
set MSYS=winsymlinks:nativestrict
%MSYS_ROOT%\msys2_shell.cmd -defterm -no-start -mingw64 -full-path -here -c "./build.sh windows_amd64"
displayName: CI-Build
env:
MSYSTEM: MINGW64
CHERE_INVOKING: yes
MINGW_INSTALLS: mingw64
- publish: _packages/build_$(ARCH)/publish
artifact: fpga-toolchain-$(ARCH)-$(RELEASE_TAG)
- publish: _packages/build_$(ARCH)/publish_symbols
artifact: symbols_fpga-toolchain-$(ARCH)-$(RELEASE_TAG)
- stage: run_tests
displayName: run tests
condition: always()
jobs:
- job: run_tests
displayName: run tests
timeoutInMinutes: 0
strategy:
matrix:
linux_x86_64:
ARCH: linux_x86_64
vm_image: ubuntu-16.04
windows_amd64:
ARCH: windows_amd64
vm_image: vs2017-win2016
darwin:
ARCH: darwin
vm_image: macOS-10.14
pool:
vmImage: '$(vm_image)'
steps:
- bash: |
RELEASE_TAG=nightly-$(date +'%Y%m%d')
# create pipeline variable
echo "##vso[task.setvariable variable=RELEASE_TAG]$RELEASE_TAG"
- task: DownloadPipelineArtifact@2
inputs:
source: current
artifact: fpga-toolchain-$(ARCH)-$(RELEASE_TAG)
path: '$(Build.Repository.LocalPath)'
# source: 'specific'
# project: '4615f283-ee51-4dbc-992b-cdd560f6506b'
# pipeline: '1'
# runVersion: 'specific'
# runId: '349' # this is buildId in the URL
- bash: export VERSION=$(RELEASE_TAG) && ./scripts/test/run_tests.sh $(ARCH)
displayName: Run tests
name: run_tests
- stage: publish_release
displayName: publish release
# only generate a github release on main (dev branches still have artifacts that can be downloaded)
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
jobs:
- job: publish_release
displayName: publish_release
timeoutInMinutes: 0
pool:
vmImage: ubuntu-18.04
variables:
"System.Debug": true
steps:
- bash: |
RELEASE_TAG=nightly-$(date +'%Y%m%d')
# create pipeline variable
echo "##vso[task.setvariable variable=RELEASE_TAG]$RELEASE_TAG"
- download: current
patterns: '**/fpga-toolchain*.*'
- task: GitHubRelease@0
inputs:
gitHubConnection: yosyshq-release
repositoryName: '$(Build.Repository.Name)'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'manual'
tag: '$(RELEASE_TAG)'
addChangeLog: false
releaseNotesSource: 'input'
releaseNotes: '$(RELEASE_TAG)'
assets: |
$(Pipeline.Workspace)/**/fpga-toolchain*.tar.*
$(Pipeline.Workspace)/**/fpga-toolchain*.zip
$(Pipeline.Workspace)/**/fpga-toolchain*.7z