forked from chipsalliance/chisel
-
Notifications
You must be signed in to change notification settings - Fork 0
291 lines (278 loc) · 9 KB
/
test.yml
File metadata and controls
291 lines (278 loc) · 9 KB
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
285
286
287
288
289
290
291
name: Test Chisel
on:
workflow_call:
inputs:
system:
description: 'The GitHub runner to use'
default: 'ubuntu-24.04'
required: true
type: string
jvm:
description: 'The Java version to use'
default: 8
required: true
type: number
scala:
description: 'The Scala version to use'
default: '2.13.18'
required: true
type: string
espresso:
description: 'The espresso version to use'
default: '2.4'
required: true
type: string
slang:
description: 'The slang version to use'
default: '7.0'
required: true
type: string
circt:
description: 'The CIRCT version to use (must be a valid release tag, "nightly", or "version-file").
Leave off (or empty) to let Chisel manage the CIRCT version'
type: string
ref:
description: 'The branch, tag, or git hash to checkout'
default: ''
required: false
type: string
jobs:
ci:
name: ci
runs-on: ${{ inputs.system }}
steps:
- name: Checkout
uses: actions/checkout@v5
with:
ref: ${{ inputs.ref }}
- name: Install Tabby OSS Cad Suite
uses: ./.github/workflows/setup-oss-cad-suite
- name: Install Espresso
uses: ./.github/workflows/install-espresso
with:
version: ${{ inputs.espresso }}
- name: Install Slang
uses: ./.github/workflows/build-slang
with:
version: ${{ inputs.slang }}
- name: Install FileCheck
run: |
sudo apt update
sudo apt install llvm-19-tools
echo "/usr/lib/llvm-19/bin" >> $GITHUB_PATH
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: 'adopt'
java-version: ${{ inputs.jvm }}
- name: Install CIRCT
id: install-circt
if: ${{ inputs.circt }}
uses: circt/install-circt@3f8dda6e1c1965537b5801a43c81c287bac4eae4 # v1.1.1
with:
version: ${{ inputs.circt }}
github-token: ${{ github.token }}
# TODO have install-circt do this
- name: Set CHISEL_FIRTOOL_PATH
if: steps.install-circt.outcome == 'success'
run: |
dir=$(dirname $(which firtool))
echo "CHISEL_FIRTOOL_PATH=$dir" >> "$GITHUB_ENV"
- name: Print firtool version
if: steps.install-circt.outcome == 'success'
run: |
echo "The CIRCT version used is:" >> $GITHUB_STEP_SUMMARY
echo \`\`\` >> $GITHUB_STEP_SUMMARY
$CHISEL_FIRTOOL_PATH/firtool -version >> $GITHUB_STEP_SUMMARY
echo \`\`\` >> $GITHUB_STEP_SUMMARY
- name: Test
run: ./mill -j0 firrtl.cross[].test -oF + svsim.cross[].test -oF + chisel[_].test -oF
mima:
name: binary compatibility checking
runs-on: ${{ inputs.system }}
steps:
- name: Checkout
uses: actions/checkout@v5
with:
ref: ${{ inputs.ref }}
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: 'adopt'
java-version: ${{ inputs.jvm }}
- name: Check Binary Compatibility with MiMa
run: ./mill __.mimaReportBinaryIssues
mill:
name: compile project with mill
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v5
with:
ref: ${{ inputs.ref }}
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: 'adopt'
java-version: ${{ inputs.jvm }}
- name: Install CIRCT
id: install-circt
if: ${{ inputs.circt }}
uses: circt/install-circt@3f8dda6e1c1965537b5801a43c81c287bac4eae4 # v1.1.1
with:
version: ${{ inputs.circt }}
github-token: ${{ github.token }}
# TODO have install-circt do this
- name: Set CHISEL_FIRTOOL_PATH and CIRCT_INSTALL_PATH
if: steps.install-circt.outcome == 'success'
run: |
bindir=$(dirname $(which firtool))
installdir=$(dirname $bindir)
echo "CHISEL_FIRTOOL_PATH=$bindir" >> "$GITHUB_ENV"
echo "CIRCT_INSTALL_PATH=$installdir" >> "$GITHUB_ENV"
- name: Print firtool version
if: steps.install-circt.outcome == 'success'
run: |
echo "The CIRCT version used is:" >> $GITHUB_STEP_SUMMARY
echo \`\`\` >> $GITHUB_STEP_SUMMARY
$CHISEL_FIRTOOL_PATH/firtool -version >> $GITHUB_STEP_SUMMARY
echo \`\`\` >> $GITHUB_STEP_SUMMARY
- name: Compile with Mill
run: ./mill compileAll
doc:
name: Formatting
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v5
with:
ref: ${{ inputs.ref }}
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: 'adopt'
java-version: ${{ inputs.jvm }}
- name: Check Build Script Formatting
run: ./mill --meta-level 1 mill.scalalib.scalafmt.ScalafmtModule/checkFormatAll sources
- name: Check Source File Format
run: ./mill __.checkFormat
integration:
name: Integration Tests
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v5
with:
ref: ${{ inputs.ref }}
- name: Install Tabby OSS Cad Suite
uses: ./.github/workflows/setup-oss-cad-suite
- name: Install Espresso
uses: ./.github/workflows/install-espresso
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: 'adopt'
java-version: ${{ inputs.jvm }}
- name: Install CIRCT
id: install-circt
if: ${{ inputs.circt }}
uses: circt/install-circt@3f8dda6e1c1965537b5801a43c81c287bac4eae4 # v1.1.1
with:
version: ${{ inputs.circt }}
github-token: ${{ github.token }}
# TODO have install-circt do this
- name: Set CHISEL_FIRTOOL_PATH
if: steps.install-circt.outcome == 'success'
run: |
dir=$(dirname $(which firtool))
echo "CHISEL_FIRTOOL_PATH=$dir" >> "$GITHUB_ENV"
- name: Integration Tests
run: ./mill -j0 integration-tests.cross[].test -oF
# Currently just a sanity check that the benchmarking flow works
benchmark:
name: Benchmarking Sanity Check
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v5
with:
ref: ${{ inputs.ref }}
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: 'adopt'
java-version: ${{ inputs.jvm }}
- name: JMH
run: ./mill benchmark.runJmh
std:
name: Standard Library
runs-on: ubuntu-24.04
strategy:
matrix:
scala: ["2.13.18"]
steps:
- name: Checkout
uses: actions/checkout@v5
with:
ref: ${{ inputs.ref }}
- name: Install Tabby OSS Cad Suite
uses: ./.github/workflows/setup-oss-cad-suite
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: 'adopt'
java-version: ${{ inputs.jvm }}
- name: Compile
run: ./mill stdlib.cross[_].compile
website:
name: Build Mdoc & Website
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v5
with:
ref: ${{ inputs.ref }}
# Need full history to correctly determine SNAPSHOT version
fetch-depth: 0
- name: Install Tabby OSS Cad Suite
uses: ./.github/workflows/setup-oss-cad-suite
- name: Cache Scala
uses: coursier/cache-action@bebeeb0e6f48ebad66d3783946588ecf43114433 # v7.0.0
- name: Setup Scala
uses: VirtusLab/scala-cli-setup@77834b5926f3eb70869d8009530c65585f7a039b # v1.9.1
with:
jvm: adoptium:17
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 24
- name: Install CIRCT
id: install-circt
if: ${{ inputs.circt }}
uses: circt/install-circt@3f8dda6e1c1965537b5801a43c81c287bac4eae4 # v1.1.1
with:
version: ${{ inputs.circt }}
github-token: ${{ github.token }}
# TODO have install-circt do this
- name: Set CHISEL_FIRTOOL_PATH
if: steps.install-circt.outcome == 'success'
run: |
dir=$(dirname $(which firtool))
echo "CHISEL_FIRTOOL_PATH=$dir" >> "$GITHUB_ENV"
# TODO: make the website building include building ScalaDoc
- name: Build the website
run: make -C website build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Tar built website
run: tar zcf website.tar.gz website/build
- name: Share Built Website
uses: actions/upload-artifact@v5
with:
name: website
path: website.tar.gz
scala-cli-example:
name: Test Scala-CLI Example
uses: ./.github/workflows/build-scala-cli-example.yml
with:
circt: ${{ inputs.circt }}