Skip to content

Commit c86545f

Browse files
committed
Added live site with typelevel site and laika.
Note: The Old Releases Page may not work if we are moving away from the old scalacheck.org website. The old website has a `files/` folder that would need to still be up and running for that page to work. It could very well be that we don't want to maintain the very old releases anymore so we can forego advertising those releases
1 parent dab93b0 commit c86545f

21 files changed

Lines changed: 2381 additions & 3 deletions

.github/workflows/ci.yml

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ jobs:
327327
- name: Submit Dependencies
328328
uses: scalacenter/sbt-dependency-submission@v2
329329
with:
330-
modules-ignore: rootjs_3 rootjs_2.12 rootjs_2.13 rootjvm_3 rootjvm_2.12 rootjvm_2.13 rootnative_3 rootnative_2.12 rootnative_2.13 scalacheck-bench_3 scalacheck-bench_2.12 scalacheck-bench_2.13
330+
modules-ignore: rootjs_3 rootjs_2.12 rootjs_2.13 docs_3 docs_2.12 docs_2.13 rootjvm_3 rootjvm_2.12 rootjvm_2.13 rootnative_3 rootnative_2.12 rootnative_2.13 scalacheck-bench_3 scalacheck-bench_2.12 scalacheck-bench_2.13
331331
configs-ignore: test scala-tool scala-doc-tool test-internal
332332

333333
examples:
@@ -421,3 +421,56 @@ jobs:
421421

422422
- name: Build benchmark suite
423423
run: 'sbt ''++ ${{ matrix.scala }}'' ''bench/jmh:run -p genSize=0 -p seedCount=0 -bs 1 -wi 0 -i 1 -f 0 -t 1 -r 0 org.scalacheck.bench.GenBench'''
424+
425+
site:
426+
name: Generate Site
427+
strategy:
428+
matrix:
429+
os: [ubuntu-22.04]
430+
java: [temurin@11]
431+
runs-on: ${{ matrix.os }}
432+
steps:
433+
- name: Checkout current branch (full)
434+
uses: actions/checkout@v6
435+
with:
436+
fetch-depth: 0
437+
438+
- name: Setup sbt
439+
uses: sbt/setup-sbt@v1
440+
441+
- name: Setup Java (temurin@8)
442+
id: setup-java-temurin-8
443+
if: matrix.java == 'temurin@8'
444+
uses: actions/setup-java@v5
445+
with:
446+
distribution: temurin
447+
java-version: 8
448+
cache: sbt
449+
450+
- name: sbt update
451+
if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
452+
run: sbt +update
453+
454+
- name: Setup Java (temurin@11)
455+
id: setup-java-temurin-11
456+
if: matrix.java == 'temurin@11'
457+
uses: actions/setup-java@v5
458+
with:
459+
distribution: temurin
460+
java-version: 11
461+
cache: sbt
462+
463+
- name: sbt update
464+
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
465+
run: sbt +update
466+
467+
- name: Generate site
468+
run: sbt docs/tlSite
469+
470+
- name: Publish site
471+
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
472+
uses: peaceiris/[email protected]
473+
with:
474+
github_token: ${{ secrets.GITHUB_TOKEN }}
475+
publish_dir: site/target/docs/site
476+
keep_files: true

build.sbt

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,114 @@ ThisBuild / tlMimaPreviousVersions ++= Set(
6969
)
7070
ThisBuild / tlVersionIntroduced := Map("3" -> "1.15.3")
7171

72+
// publish website from this branch
73+
ThisBuild / tlSitePublishBranch := Some("main")
74+
75+
import laika.config.{LinkConfig, MessageFilters, SyntaxHighlighting, TargetDefinition, Version, Versions}
76+
import laika.helium.Helium
77+
import laika.helium.config.{Favicon, HeliumIcon, IconLink, LinkPanel, ReleaseInfo, Teaser, TextLink}
78+
import laika.ast.Path.Root
79+
import laika.ast.Image
80+
import laika.format.Markdown
81+
import laika.theme.config.Color
82+
83+
val scalaCheckRepo = "https://github.com/typelevel/scalacheck"
84+
val latestVersion = "1.19.0"
85+
86+
lazy val docs = project.in(file("site"))
87+
.enablePlugins(TypelevelSitePlugin)
88+
.settings(
89+
laikaExtensions ++= Seq(
90+
Markdown.GitHubFlavor,
91+
SyntaxHighlighting
92+
),
93+
laikaTheme :=
94+
Helium.defaults
95+
.site.landingPage(
96+
logo = Some(Image.internal(Root / "images/logo_forall_transparent.png")),
97+
title = Some("ScalaCheck"),
98+
subtitle = Some("Property Based Testing for Scala"),
99+
latestReleases = Seq(
100+
Some(ReleaseInfo("Latest Stable Release", tlBaseVersion.value)),
101+
tlLatestPreReleaseVersion.value.map(s => ReleaseInfo("Latest Milestone Release", s))
102+
).flatten,
103+
linkPanel = Some(LinkPanel(
104+
"Documentation",
105+
TextLink.internal(Root / "main.md", "Introduction"),
106+
TextLink.internal(Root / "resources.md", "Resources"),
107+
TextLink.internal(Root / "download.md", "Download"),
108+
TextLink.internal(Root / "userguide.md", "User Guide"),
109+
TextLink.internal(Root / "sources.md", "Sources"),
110+
TextLink.internal(Root / "api.md", "API"),
111+
TextLink.internal(Root / "old_releases.md", "Old Releases")
112+
)),
113+
projectLinks = Seq(
114+
TextLink.external("https://github.com/typelevel/scalacheck", "Source on Github"),
115+
TextLink.external(
116+
"https://discord.com/channels/632277896739946517/841617753513263144",
117+
"Discussions on Discord"),
118+
TextLink.external("https://github.com/typelevel/scalacheck/discussions", "Discussions on GitHub"),
119+
TextLink.external("https://github.com/typelevel/scalacheck/issues", "Issues on GitHub")
120+
),
121+
license = Some("BSD-3-Clause"),
122+
teasers = Seq(
123+
Teaser(
124+
"Thorough",
125+
"Write a single property and let ScalaCheck execute it hundreds or thousands of times. Instead of a handful of examples, you explore a wide space of possible inputs automatically. This gives you confidence that your code behaves correctly beyond the obvious cases."
126+
),
127+
Teaser(
128+
"Generative",
129+
"Stop hand-crafting test data and let ScalaCheck generate it for you. From simple values to complex domain objects, generators produce diverse scenarios effortlessly. Your tests evolve from examples into full explorations of behavior."
130+
),
131+
Teaser(
132+
"Exploratory",
133+
"ScalaCheck helps you uncover edge cases you didn’t know existed. By exploring random and structured inputs, it reveals hidden assumptions in your code. Many bugs surface not because you expected them, but because ScalaCheck went looking."
134+
),
135+
Teaser(
136+
"Minimal",
137+
"When a test fails, ScalaCheck doesn’t just stop, it shrinks the input. It searches for the smallest, simplest example that still reproduces the failure. Debugging becomes faster because you’re working with minimal, focused data."
138+
),
139+
Teaser(
140+
"Expressive",
141+
"Tests read like laws or truths about your system. Instead of imperative scripts, you write clear statements of intent. This makes your test suite easier to understand and communicate."
142+
)
143+
)
144+
)
145+
.site.themeColors(
146+
primary = Color.hex("818589"),
147+
primaryLight = Color.hex("FFF6CC"),
148+
primaryMedium = Color.hex("8A7A3B"),
149+
secondary = Color.hex("2B2B2B"),
150+
text = Color.hex("818589"),
151+
background = Color.hex("FFFDF5"),
152+
bgGradient = (Color.hex("FFFDF5"), Color.hex("FFF3BF"))
153+
)
154+
.site.favIcons(
155+
Favicon.internal(Root / "images/favicon.ico", sizes = "32x32")
156+
)
157+
.site.topNavigationBar(
158+
homeLink = IconLink.internal(Root / "main.md", HeliumIcon.home)
159+
)
160+
.site.footer(Image.internal(Root / "images/logo_forall_h30.png"))
161+
.build,
162+
163+
laikaConfig := {
164+
165+
LaikaConfig
166+
.defaults
167+
.withMessageFilters(MessageFilters.forVisualDebugging)
168+
.withConfigValue(
169+
LinkConfig.empty.addTargets(
170+
TargetDefinition.external("ScalaCheck Repository", scalaCheckRepo),
171+
TargetDefinition.external("ScalaCheck Bug Reports", s"$scalaCheckRepo/issues"),
172+
TargetDefinition.external("ScalaCheck Discussions on GitHub", s"$scalaCheckRepo/discussions"),
173+
TargetDefinition.external("report an issue", s"$scalaCheckRepo/issues"),
174+
TargetDefinition.external("submit a pull request", s"$scalaCheckRepo/pull")
175+
)
176+
)
177+
}
178+
)
179+
72180
lazy val root = tlCrossRootProject.aggregate(core, bench)
73181
.settings(
74182
Compile / headerSources ++= Seq(

0 commit comments

Comments
 (0)