forked from themperek/cocotb-test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
142 lines (119 loc) · 5.23 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
trigger:
branches:
include:
- '*'
jobs:
- job:
strategy:
matrix:
Linux-Icarus-py38:
python.version: "3.8"
imageName: "ubuntu-latest"
SIM: "icarus"
Linux-GHDL-py38:
python.version: "3.8"
imageName: "ubuntu-latest"
SIM: "ghdl"
Windows-Icarus-py38:
python.version: "3.8"
imageName: "windows-latest"
SIM: "icarus"
Mac-Icarus-py38:
imageName: "macOS-latest"
python.version: "3.8"
SIM: "icarus"
Linux-Verilator-py38:
python.version: "3.8"
imageName: "ubuntu-latest"
SIM: "verilator"
pool:
vmImage: $(imageName)
variables:
SIM: $(SIM)
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.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: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
condition: ne( variables['Agent.OS'], 'Windows_NT' )
- script: |
sudo chown -R $USER $CONDA
gcc --version
displayName: Take ownership of conda installation
condition: eq( variables['Agent.OS'], 'Darwin' )
- script: conda init
displayName: Init Conda
- script: |
conda install -y python=$(python.version) pytest
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 git make autoconf g++ flex bison # First time prerequisites
sudo apt-get install libfl2 # Ubuntu only (ignore if gives error)
sudo apt-get install libfl-dev # Ubuntu only (ignore if gives error)
git clone http://git.veripool.org/git/verilator -b v4.106 --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' )
- script: |
pip install pytest-parallel
displayName: "Install pytest-parallel"
- script: |
pip install pytest-xdist
displayName: "Install pytest-xdist"
- script: |
conda install --yes pip && git clone -b v1.6.0 https://github.com/cocotb/cocotb.git && cd cocotb && cd .. && pip install -e cocotb
displayName: "Install cocotb from source"
- script: |
pip install -e .
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: ne( variables['Agent.OS'], 'Windows_NT' )
- script: |
pytest -m compile tests/test_parallel.py
pytest -m "not compile" -n 2 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)"