forked from chipsalliance/chisel
-
Notifications
You must be signed in to change notification settings - Fork 0
252 lines (242 loc) · 7.59 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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
name: Test Chisel
on:
workflow_call:
inputs:
system:
description: 'The GitHub runner to use'
default: 'ubuntu-22.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.12'
required: true
type: string
espresso:
description: 'The espresso version to use'
default: '2.4'
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@v3
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: Setup Scala
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: ${{ inputs.jvm }}
cache: 'sbt'
- name: Install CIRCT
id: install-circt
if: ${{ inputs.circt }}
uses: circt/[email protected]
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: sbt ++${{ inputs.scala }} test
- name: Binary compatibility
# TODO either make this also check the plugin or decide that we don't
# support binary compatibility for the plugin
run: sbt ++${{ inputs.scala }} unipublish/mimaReportBinaryIssues
mill:
name: compile project with mill
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
# FIXME: installling jextract before installing mill to workaround `os.proc` can't find jextract in the outdated PATH env from mill server
- name: Install Jextract
uses: ./.github/workflows/install-jextract
- name: Setup Scala
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '21'
cache: 'sbt'
- name: Install Mill
uses: jodersky/[email protected]
with:
mill-version: 0.11.5
# Mill needs firtool to compile with bindings, cannot use firtool-resolver at runtime
- name: Pick CIRCT version
id: circt-version
run: |
if [[ -z "${{ inputs.circt }}" ]]; then
echo "version=version-file" >> "$GITHUB_OUTPUT"
else
echo "version=${{ inputs.circt }}" >> "$GITHUB_OUTPUT"
fi
- name: Install CIRCT
uses: circt/[email protected]
with:
version: ${{ steps.circt-version.outputs.version }}
github-token: ${{ github.token }}
- name: Compile Mill
run: |
export CIRCT_INSTALL_PATH="$(pwd)/circt"
mill __.compile
doc:
name: Formatting
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
- name: Setup Scala
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
cache: 'sbt'
- name: Check Formatting
run: sbt fmtCheck
integration:
name: Integration Tests
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
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 Scala
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
cache: 'sbt'
- name: Install CIRCT
id: install-circt
if: ${{ inputs.circt }}
uses: circt/[email protected]
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: sbt integrationTests/test
std:
name: Standard Library Tests
runs-on: ubuntu-22.04
strategy:
matrix:
scala: ["2.13.12"]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
- name: Install Tabby OSS Cad Suite
uses: ./.github/workflows/setup-oss-cad-suite
- name: Setup Scala
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
cache: 'sbt'
- name: Check Formatting
run: sbt ++${{ inputs.scala }} standardLibrary/scalafmtCheckAll
- name: Unit Tests
run: sbt ++${{ inputs.scala }} standardLibrary/test
website:
name: Build Mdoc & Website
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
# Need full history to correctly determine SNAPSHOT version
fetch-depth: 0
- name: Cache Scala
uses: coursier/cache-action@v6
- name: Setup Scala
uses: VirtusLab/scala-cli-setup@v1
with:
jvm: adoptium:17
apps: sbt
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install CIRCT
id: install-circt
if: ${{ inputs.circt }}
uses: circt/[email protected]
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@v3
with:
name: website
path: website.tar.gz
scala-cli-template:
name: Test Scala-CLI Template
uses: ./.github/workflows/build-scala-cli-template.yml
with:
circt: ${{ inputs.circt }}