This repository has been archived by the owner on Aug 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 74
233 lines (217 loc) · 6.88 KB
/
test.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
name: Continuous Integration
on:
pull_request:
push:
branches:
- main
- 0.5.x
- 0.3.x
jobs:
test:
name: sbt test on ubuntu
runs-on: ubuntu-20.04
strategy:
matrix:
scala: [2.13.10]
jvm: [8, 11]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Scala
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: ${{ matrix.jvm }}
- name: Test
timeout-minutes: 6
run: sbt ++${{ matrix.scala }} "testOnly chiseltest.** -- -l RequiresVcs -l RequiresVerilator -l Formal -l RequiresIcarus"
integration-test:
name: Integration Tests
runs-on: ubuntu-20.04
strategy:
matrix:
scala: [ 2.13.10 ]
jvm: [ 8, 11, 20 ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Scala
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: ${{ matrix.jvm }}
- name: Test
timeout-minutes: 6
run: sbt ++${{ matrix.scala }} "testOnly integration.**"
test-mac:
name: sbt test on mac
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Test
timeout-minutes: 10
run: sbt "testOnly chiseltest.** -- -l RequiresVcs -l RequiresVerilator -l Formal -l RequiresIcarus"
icarus:
name: icarus verilog
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-20.04, macos-latest ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Icarus Verilog for Ubuntu
if: runner.os == 'Linux'
run: |
sudo apt-get install -y iverilog
iverilog -v || true
- name: Install Icarus Verilog for MacOS
if: runner.os == 'macOS'
run: |
brew install icarus-verilog
iverilog -v || true
- name: Test
timeout-minutes: 6
run: sbt ++${{ matrix.scala }} "testOnly chiseltest.** -- -n RequiresIcarus"
verilator:
name: verilator regressions
runs-on: ubuntu-20.04
strategy:
matrix:
# 4.028: Ubuntu 20.04, Fedora 32
# 4.032: Fedora 33
# 4.034: Chipyard
# 4.038: Ubuntu 20.10
# 4.108: Fedora 34
# 4.200: currently the latest version on brew (MacOS)
# 4.202: added "forcePerInstance" to support our coverage flow
version: ["4.028", "4.032", "4.034", "4.038", "4.108", "4.200", "4.202"]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Verilator Build Dependencies
run: sudo apt-get install -y git make autoconf g++ flex bison libfl2 libfl-dev
- name: Cache Verilator ${{ matrix.version }}
uses: actions/cache@v3
id: cache-verilator
with:
path: verilator-${{ matrix.version }}
key: ${{ runner.os }}-verilator-${{ matrix.version }}
- name: Compile Verilator ${{ matrix.version }}
if: steps.cache-verilator.outputs.cache-hit != 'true'
run: |
wget https://github.com/verilator/verilator/archive/refs/tags/v${{ matrix.version }}.zip
unzip v${{ matrix.version }}.zip
cd verilator-${{ matrix.version }}
autoconf
./configure
make
- name: Install Verilator ${{ matrix.version }}
run: |
cd verilator-${{ matrix.version }}
sudo make install
verilator --version
- name: Test
run: sbt "testOnly chiseltest.** -- -n RequiresVerilator"
formal:
name: formal verification tests
runs-on: ubuntu-20.04
strategy:
matrix:
backend: [z3, cvc4, btormc, bitwuzla]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Z3 and CVC4
if: runner.os == 'Linux'
run: |
sudo apt-get install -y z3 cvc4
z3 --version
cvc4 --version
- name: Install Tabby OSS Cad Suite (from YosysHQ)
uses: ./.github/workflows/setup-oss-cad-suite
with:
osscadsuite-version: '2023-01-09'
- name: Test
run: sbt "testOnly chiseltest.** -- -n Formal -Dformal_engine=${{ matrix.backend }}"
formal-mac:
name: formal verification tests on mac
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Z3 for MacOS
run: |
brew install z3
z3 --version
- name: Test
run: sbt "testOnly chiseltest.** -- -n Formal -Dformal_engine=z3"
doc:
name: Documentation and Formatting
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Documentation
id: doc
run: sbt doc
- name: Check Formatting
run: sbt scalafmtCheckAll
no-warn:
name: No Warnings with Scala 2.13 for PRs
if: github.event_name == 'pull_request'
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check for Warnings
run: sbt "set ThisBuild / scalacOptions ++= Seq(\"-Xfatal-warnings\") ; compile"
- name: Check for Warnings in Tests
run: sbt "set ThisBuild / scalacOptions ++= Seq(\"-Xfatal-warnings\") ; Test / compile"
test-treadle:
name: sbt test for treadle on ubuntu
runs-on: ubuntu-20.04
strategy:
matrix:
scala: [2.13.10]
jvm: [8, 11]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Scala
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: ${{ matrix.jvm }}
- name: Test
run: sbt ++${{ matrix.scala }} "testOnly treadle2.**"
# Sentinel job to simplify how we specify which checks need to pass in branch
# protection and in Mergify
#
# When adding new jobs, please add them to `needs` below
all_tests_passed:
name: "all tests passed"
needs: [test, doc, verilator, formal, formal-mac, icarus, test-mac, no-warn, integration-test]
runs-on: ubuntu-latest
steps:
- run: echo Success!
# sbt ci-release publishes all cross versions so this job needs to be
# separate from a Scala versions build matrix to avoid duplicate publishing
publish:
# note: we do not require a warning check for publishing!
needs: [test, doc, verilator, formal, formal-mac, icarus, test-mac, test-treadle, integration-test]
runs-on: ubuntu-20.04
if: github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup GPG (for Publish)
uses: olafurpg/setup-gpg@v3
- name: Publish
run: sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}