Skip to content

Commit 3f5ca9d

Browse files
committed
Add compileAll function in build.sc
Use compileAll in CI Mill compilation
1 parent 9f2f19c commit 3f5ca9d

File tree

2 files changed

+15
-41
lines changed

2 files changed

+15
-41
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
$CHISEL_FIRTOOL_PATH/firtool -version >> $GITHUB_STEP_SUMMARY
9191
echo \`\`\` >> $GITHUB_STEP_SUMMARY
9292
- name: Test
93-
run: ./mill -j0 firrtl[_].test + svsim[_].test + chisel[_].test
93+
run: ./mill -j0 firrtl[].test + svsim[].test + chisel[].test
9494
- name: Binary compatibility
9595
# TODO either make this also check the plugin or decide that we don't
9696
# support binary compatibility for the plugin
@@ -132,45 +132,7 @@ jobs:
132132
$CHISEL_FIRTOOL_PATH/firtool -version >> $GITHUB_STEP_SUMMARY
133133
echo \`\`\` >> $GITHUB_STEP_SUMMARY
134134
- name: Compile with Mill
135-
run: ./mill chisel[].compile
136-
137-
mill3:
138-
name: compile scala-3 project with mill
139-
runs-on: ubuntu-22.04
140-
steps:
141-
- name: Checkout
142-
uses: actions/checkout@v4
143-
with:
144-
ref: ${{ inputs.ref }}
145-
- name: Setup Java
146-
uses: actions/setup-java@v4
147-
with:
148-
distribution: 'adopt'
149-
java-version: '21'
150-
- name: Install CIRCT
151-
id: install-circt
152-
if: ${{ inputs.circt }}
153-
uses: circt/[email protected]
154-
with:
155-
version: ${{ inputs.circt }}
156-
github-token: ${{ github.token }}
157-
# TODO have install-circt do this
158-
- name: Set CHISEL_FIRTOOL_PATH and CIRCT_INSTALL_PATH
159-
if: steps.install-circt.outcome == 'success'
160-
run: |
161-
bindir=$(dirname $(which firtool))
162-
installdir=$(dirname $bindir)
163-
echo "CHISEL_FIRTOOL_PATH=$bindir" >> "$GITHUB_ENV"
164-
echo "CIRCT_INSTALL_PATH=$installdir" >> "$GITHUB_ENV"
165-
- name: Print firtool version
166-
if: steps.install-circt.outcome == 'success'
167-
run: |
168-
echo "The CIRCT version used is:" >> $GITHUB_STEP_SUMMARY
169-
echo \`\`\` >> $GITHUB_STEP_SUMMARY
170-
$CHISEL_FIRTOOL_PATH/firtool -version >> $GITHUB_STEP_SUMMARY
171-
echo \`\`\` >> $GITHUB_STEP_SUMMARY
172-
- name: Compile with Mill
173-
run: ./mill chisel[3.3.4].compile
135+
run: ./mill compileAll
174136

175137
doc:
176138
name: Formatting
@@ -188,7 +150,7 @@ jobs:
188150
- name: Check Build Script Formatting
189151
run: ./mill --meta-level 1 mill.scalalib.scalafmt.ScalafmtModule/checkFormatAll sources
190152
- name: Check Source File Format
191-
run: ./mill chisel[].checkFormat
153+
run: ./mill __.checkFormat
192154

193155
integration:
194156
name: Integration Tests

build.sc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ object v extends Module {
4545

4646
def isScala3(ver: String): Boolean = ver.startsWith("3.")
4747

48+
def buildUnits(): Seq[ScalaModule] = {
49+
scalaCrossVersions.flatMap { ver =>
50+
Seq(chisel(ver), stdlib(ver), unipublish)
51+
} ++ scalaCrossVersions.filterNot(isScala3(_)).flatMap { ver2 =>
52+
Seq(chisel(ver2).test)
53+
}
54+
}
55+
4856
val scalaVersion = scalaCrossVersions.head
4957
val jmhVersion = "1.37"
5058
val osLib = ivy"com.lihaoyi::os-lib:0.10.0"
@@ -98,6 +106,10 @@ object v extends Module {
98106
)
99107
}
100108

109+
def compileAll() = T.command {
110+
T.traverse(v.buildUnits())(_.compile)()
111+
}
112+
101113
trait ChiselPublishModule extends CiReleaseModule {
102114
// Publish information
103115
def pomSettings = PomSettings(

0 commit comments

Comments
 (0)