Skip to content

Commit 1d0b07c

Browse files
committed
Cross compile docs-tests on Scala 3 LTS & Next
1 parent 05eaedd commit 1d0b07c

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ jobs:
912912
- name: Build documentation
913913
run: .github/scripts/build-website.sh
914914
- name: Test documentation
915-
run: ./mill -i docs-tests.test
915+
run: ./mill -i 'docs-tests[]'.test
916916
- name: Convert Mill test reports to JUnit XML format
917917
if: success() || failure()
918918
run: .github/scripts/generate-junit-reports.sc docs-tests 'Scala CLI Docs Tests' test-report.xml out/

DEV.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -235,36 +235,36 @@ We have a built-in tool to validate `.md` files called [Sclicheck](/sclicheck/Re
235235
All `Sclicheck` tests can be run with `Mill` + `munit`: (and this is what we run on the CI, too)
236236

237237
```bash
238-
./mill -i docs-tests.test
238+
./mill -i 'docs-tests[]'.test
239239
```
240240

241241
The former also includes testing gifs and `Sclicheck` itself.
242242
To just check the documents, run:
243243

244244
```bash
245-
./mill -i docs-tests.test 'sclicheck.DocTests.*'
245+
./mill -i 'docs-tests[]'.test 'sclicheck.DocTests.*'
246246
```
247247

248248
You can also check all root docs, commands, reference docs, guides or cookbooks:
249249

250250
```bash
251-
./mill -i docs-tests.test 'sclicheck.DocTests.root*'
252-
./mill -i docs-tests.test 'sclicheck.DocTests.guide*'
253-
./mill -i docs-tests.test 'sclicheck.DocTests.command*'
254-
./mill -i docs-tests.test 'sclicheck.DocTests.cookbook*'
255-
./mill -i docs-tests.test 'sclicheck.DocTests.reference*'
251+
./mill -i 'docs-tests[]'.test 'sclicheck.DocTests.root*'
252+
./mill -i 'docs-tests[]'.test 'sclicheck.DocTests.guide*'
253+
./mill -i 'docs-tests[]'.test 'sclicheck.DocTests.command*'
254+
./mill -i 'docs-tests[]'.test 'sclicheck.DocTests.cookbook*'
255+
./mill -i 'docs-tests[]'.test 'sclicheck.DocTests.reference*'
256256
```
257257

258258
Similarly, you can check single files:
259259

260260
```bash
261-
./mill -i docs-tests.test 'sclicheck.DocTests.<category> <doc-name>'
261+
./mill -i 'docs-tests[]'.test 'sclicheck.DocTests.<category> <doc-name>'
262262
```
263263

264264
For example, to run the check on `compile.md`
265265

266266
```bash
267-
./mill -i docs-tests.test 'sclicheck.DocTests.command compile'
267+
./mill -i 'docs-tests[]'.test 'sclicheck.DocTests.command compile'
268268
```
269269

270270
## Scala CLI logos

build.sc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,11 @@ object integration extends CliIntegration {
132132
}
133133
}
134134

135-
object `docs-tests` extends SbtModule with ScalaCliScalafixModule with HasTests { main =>
136-
def scalaVersion = Scala.defaultInternal
135+
object `docs-tests` extends Cross[DocsTests](Scala.allScala3){
136+
def defaultCrossSegments = Seq(Scala.defaultInternal)
137+
}
138+
139+
trait DocsTests extends CrossSbtModule with ScalaCliScalafixModule with HasTests { main =>
137140
def ivyDeps = Agg(
138141
Deps.fansi,
139142
Deps.osLib,
@@ -144,7 +147,7 @@ object `docs-tests` extends SbtModule with ScalaCliScalafixModule with HasTests
144147
}
145148
def extraEnv = T {
146149
Seq(
147-
"SCLICHECK_SCALA_CLI" -> cli(Scala.defaultInternal).standaloneLauncher().path.toString,
150+
"SCLICHECK_SCALA_CLI" -> cli(crossScalaVersion).standaloneLauncher().path.toString,
148151
"SCALA_CLI_CONFIG" -> (tmpDirBase().path / "config" / "config.json").toString
149152
)
150153
}

modules/docs-tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Sclicheck accepts following arguments: `[--dest <dest>] [--step] [--stopAtFailur
2424

2525
Sclicheck can be run from the Scala CLI sources root with
2626
```text
27-
$ ./mill -i docs-tests.run …args…
27+
$ ./mill -i 'docs-tests[]'.run …args…
2828
```
2929

3030
## Example

0 commit comments

Comments
 (0)