Skip to content

Commit

Permalink
Setup sbt-bundlemon
Browse files Browse the repository at this point in the history
  • Loading branch information
armanbilge committed Jul 18, 2022
1 parent 2273e3d commit ba0a600
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ jobs:
if: matrix.java == 'temurin@8'
run: 'sbt ''++${{ matrix.scala }}'' ''set Global / useJSEnv := JSEnv.${{ matrix.jsenv }}'' doc'

- name: Monitor artifact size
if: matrix.jsenv == 'Chrome'
run: 'sbt ''++${{ matrix.scala }}'' ''set Global / useJSEnv := JSEnv.${{ matrix.jsenv }}'' aftifactSizeTest/bundleMon'

- name: Check scalafix lints
if: matrix.java == 'temurin@8' && !startsWith(matrix.scala, '3.')
run: 'sbt ''++${{ matrix.scala }}'' ''set Global / useJSEnv := JSEnv.${{ matrix.jsenv }}'' ''scalafixAll --check'''
Expand All @@ -110,11 +114,11 @@ jobs:

- name: Make target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/series/0.2')
run: mkdir -p target site/target tests/target dom/target tests-nodejs/target bundle-size-test/target jsdocs/target project/target
run: mkdir -p target site/target tests/target dom/target artifact-size-test/target tests-nodejs/target jsdocs/target project/target

- name: Compress target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/series/0.2')
run: tar cf targets.tar target site/target tests/target dom/target tests-nodejs/target bundle-size-test/target jsdocs/target project/target
run: tar cf targets.tar target site/target tests/target dom/target artifact-size-test/target tests-nodejs/target jsdocs/target project/target

- name: Upload target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/series/0.2')
Expand Down
File renamed without changes.
19 changes: 14 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ val munitCEVersion = "1.0.7"

lazy val root = project
.in(file("."))
.aggregate(dom, tests, nodeJSTests, bundleSizeTest)
.aggregate(dom, tests, nodeJSTests, artifactSizeTest)
.enablePlugins(NoPublishPlugin)

lazy val dom = project
Expand Down Expand Up @@ -196,16 +196,25 @@ lazy val nodeJSTests = project
.dependsOn(dom)
.enablePlugins(ScalaJSPlugin, NoPublishPlugin)

lazy val bundleSizeTest = project
.in(file("bundle-size-test"))
lazy val artifactSizeTest = project
.in(file("artifact-size-test"))
.settings(
scalaJSUseMainModuleInitializer := true,
libraryDependencies ++= Seq(
"org.http4s" %%% "http4s-circe" % http4sVersion
)
),
bundleMonCheckRun := true,
bundleMonPrComment := false
)
.dependsOn(dom)
.enablePlugins(ScalaJSPlugin, NoPublishPlugin)
.enablePlugins(BundleMonPlugin, NoPublishPlugin)

ThisBuild / githubWorkflowBuild +=
WorkflowStep.Sbt(
List("aftifactSizeTest/bundleMon"),
name = Some("Monitor artifact size"),
cond = Some("matrix.jsenv == 'Chrome'")
)

lazy val jsdocs =
project
Expand Down
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ libraryDependencies += "org.http4s" %% "http4s-dsl" % http4sVersion
libraryDependencies += "org.http4s" %% "http4s-blaze-server" % "0.23.12"

addSbtPlugin("org.http4s" % "sbt-http4s-org" % "0.14.3")
addSbtPlugin("com.armanbilge" % "sbt-bundlemon" % "0.1.0-M1")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.3.2")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.1")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")

0 comments on commit ba0a600

Please sign in to comment.