-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy pathazure-pipelines.yml
191 lines (167 loc) · 7.32 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
trigger:
branches:
include:
- '*'
jobs:
- job:
strategy:
matrix:
Linux-Icarus-py37:
python.version: "3.7"
imageName: "ubuntu-latest"
SIM: "icarus"
cocotb_version: "v1.9.0"
Linux-Icarus-py38:
python.version: "3.8"
imageName: "ubuntu-latest"
SIM: "icarus"
cocotb_version: "v1.9.0"
Linux-Icarus-py39:
python.version: "3.9"
imageName: "ubuntu-latest"
SIM: "icarus"
cocotb_version: "v1.9.0"
Linux-Icarus-py310:
python.version: "3.10"
imageName: "ubuntu-latest"
SIM: "icarus"
cocotb_version: "v1.9.0"
Linux-Icarus-py310-cocotb20:
python.version: "3.10"
imageName: "ubuntu-latest"
SIM: "icarus"
# master as of 2025-01-03
cocotb_version: "5237f9de3620aaf64e36d2e76960b9f7121bea96"
Linux-GHDL-py38:
python.version: "3.8"
imageName: "ubuntu-latest"
SIM: "ghdl"
cocotb_version: "v1.9.0"
Linux-NVC-py38:
python.version: "3.8"
imageName: "ubuntu-latest"
SIM: "nvc"
cocotb_version: "v1.9.0"
Windows-Icarus-py310:
python.version: "3.10"
imageName: "windows-latest"
SIM: "icarus"
cocotb_version: "v1.9.0"
# Mac-Icarus-py38:
# imageName: "macOS-latest"
# python.version: "3.8"
# SIM: "icarus"
# cocotb_version: "v1.9.0"
Linux-Verilator-py38:
python.version: "3.8"
imageName: "ubuntu-latest"
SIM: "verilator"
cocotb_version: "v1.9.0"
Linux-Verilator-py38-cocotb20:
python.version: "3.8"
imageName: "ubuntu-latest"
SIM: "verilator"
# master as of 2025-01-03
cocotb_version: "5237f9de3620aaf64e36d2e76960b9f7121bea96"
pool:
vmImage: $(imageName)
variables:
SIM: $(SIM)
cocotb_version: $(cocotb_version)
readonly: true
steps:
- powershell: |
Invoke-WebRequest -outfile miniconda3.exe https://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe
Start-Process .\miniconda3.exe -ArgumentList '/S /D=C:\miniconda3' -Wait
Write-Host "##vso[task.setvariable variable=CONDA;]C:\miniconda3"
Write-Host "##vso[task.prependpath]C:\miniconda3;C:\miniconda3\Library\mingw-w64\bin;C:\miniconda3\Library\usr\bin;C:\miniconda3\Library\bin;C:\miniconda3\Scripts;C:\miniconda3\bin;C:\miniconda3\condabin"
displayName: Download and Install Anaconda on Windows
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- script: |
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O ~/miniconda.sh
bash ~/miniconda.sh -b -p $HOME/miniconda
echo "##vso[task.setvariable variable=CONDA;]$HOME/miniconda"
displayName: Download and Install Anaconda on Darwin
condition: eq( variables['Agent.OS'], 'Darwin' )
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
- script: conda init
displayName: Init Conda
- script: |
conda install -y python=$(python.version)
conda update -q -y conda
displayName: Update set python version and update
- script: conda install --yes m2w64-gcc libpython
displayName: Install Windows conda development
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- script: |
sudo apt-get update
sudo apt-get install -y gnat
git clone https://github.com/ghdl/ghdl.git --depth=1 --branch v0.37
cd ghdl && ./configure && make -j2 && sudo make install && cd ..
displayName: Compile and Install GHDL on Linux
condition: and( eq( variables['Agent.OS'], 'Linux' ), eq(variables['SIM'], 'ghdl'))
- script: |
sudo apt-get update
sudo apt-get install -y build-essential automake autoconf flex check llvm-dev pkg-config zlib1g-dev libdw-dev libffi-dev libzstd-dev
git clone https://github.com/nickg/nvc.git --depth=1 --branch r1.10.4
cd nvc && ./autogen.sh && mkdir build && cd build && ../configure && make -j$(nproc) && sudo make install && cd ../..
displayName: Compile and Install NVC on Linux
condition: and( eq( variables['Agent.OS'], 'Linux' ), eq(variables['SIM'], 'nvc'))
- script: |
sudo apt-get update
sudo apt-get install git make autoconf g++ flex bison
sudo apt-get install libfl2
sudo apt-get install libfl-dev
sudo apt-get install help2man
git clone https://github.com/verilator/verilator --depth=1
cd verilator && autoconf && ./configure && make -j2 && sudo make install && cd ..
displayName: Compile and Install Verilator on Linux
condition: and( eq( variables['Agent.OS'], 'Linux' ), eq(variables['SIM'], 'verilator'))
- script: conda install --yes -c conda-forge iverilog
displayName: Install Icarus Verilog
condition: and( ne( variables['Agent.OS'], 'Windows_NT' ), eq(variables['SIM'], 'icarus'))
- script: conda install --yes -c conda-forge iverilog==10.3
displayName: Install Icarus Verilog
condition: and( eq( variables['Agent.OS'], 'Windows_NT' ), eq(variables['SIM'], 'icarus'))
- script: |
conda install --yes -c conda-forge tox
tox
displayName: "Package Test with Tox"
condition: ne( variables['Agent.OS'], 'Windows_NT' )
# AttributeError: module 'py' has no attribute 'log' for pytest 7.2
- script: |
pip install pytest-parallel pytest==7.1
displayName: "Install pytest-parallel"
- script: |
pip install pytest-xdist
displayName: "Install pytest-xdist"
- script: |
conda install --yes pip && git clone https://github.com/cocotb/cocotb.git && cd cocotb && git checkout ${{ variables.cocotb_version }} && cd .. && pip install -e cocotb
displayName: "Install cocotb from source"
- script: |
pip install .
displayName: "Install cocotb-test"
- script: |
pytest --junitxml=test-results.xml --cocotbxml=test-cocotb.xml tests
displayName: "Test with pytest"
condition: ne(variables['SIM'], 'verilator')
- script: |
pytest -m compile tests/test_parallel.py
pytest -m "not compile" --workers 2 tests/test_parallel.py
displayName: "Test with pytest-parallel"
condition: and(ne( variables['Agent.OS'], 'Windows_NT' ), ne(variables['python.version'],3.7))
- script: |
pytest -m compile tests/test_parallel.py
pytest -m "not compile" -n 2 --cocotbxml=test-cocotb.xml tests/test_parallel.py
displayName: "Test with pytest-xdidt"
condition: ne( variables['Agent.OS'], 'Windows_NT' )
- script: |
cd tests; make
displayName: "Test Makefile flow (Linux only)"
condition: and( eq( variables['Agent.OS'], 'Linux' ), eq(variables['SIM'], 'icarus'))
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: "test-*.xml"
testRunTitle: "Test results for Python $(python.version) on $(imageName) with $(SIM)"