Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
branches: ['**', '!update/**', '!pr/**']
push:
branches: ['**', '!update/**', '!pr/**']
branches: ['main']
tags: [v*]

env:
Expand All @@ -22,15 +22,15 @@ jobs:
matrix:
os: [ubuntu-latest]
scala: [3]
java: [temurin@17]
java: [temurin@21]
project: [jvm]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- uses: taiki-e/install-action@just
- uses: coursier/setup-action@main
with:
jvm: temurin@17
jvm: temurin@21
apps: scala-cli
- name: Checkout current branch (full)
uses: actions/checkout@main
Expand Down Expand Up @@ -58,11 +58,8 @@ jobs:
- name: compile
run: ./mill __.compile

# Sometimes the tests will timeout if they have to fetch all the transitive scala-js deps the first time... let's have coursier put them in the cache
- name: cache test deps
run: |
cs fetch com.raquo:laminar_sjs1_3:17.2.0
cs fetch org.scala-js:scalajs-dom_sjs1_3:2.8.0
- name: scala-cli version
run: scala-cli compile -e "()" --platform js && scala-cli run -e "()"

- name: Test
run: ./mill __.test
Expand All @@ -79,7 +76,7 @@ jobs:

- uses: coursier/setup-action@main
with:
jvm: temurin@17
jvm: temurin@21
apps: scala-cli

- name: Import GPG key
Expand Down Expand Up @@ -112,7 +109,7 @@ jobs:
steps:
- uses: coursier/setup-action@main
with:
jvm: temurin@17
jvm: temurin@21
apps: scala-cli
- uses: actions/checkout@main
with:
Expand Down
1 change: 0 additions & 1 deletion .mill-version

This file was deleted.

5 changes: 2 additions & 3 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.8.3"
version = "3.9.7"
project.git = true

runner.dialect = scala3
Expand All @@ -14,5 +14,4 @@ rewrite.scala3.insertEndMarkerMinLines = 1
newlines.beforeCurlyLambdaParams = multiline
newlines.avoidForSimpleOverflow = [tooLong]
newlines.selectChains = "unfold"
maxColumn = 120
project.excludeFilters = [ ".*/build\\.sc" ]
maxColumn = 120
105 changes: 33 additions & 72 deletions build.mill
Original file line number Diff line number Diff line change
@@ -1,34 +1,41 @@
import os.copy.over
import $ivy.`io.github.quafadas::millSite::0.0.24`
import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.4.0`
import $ivy.`com.goyeau::mill-scalafix::0.4.0`
import $file.playwrightVersion // used to cache in GHA
//| mill-version: 1.0.3
//| mill-jvm-version: 21
//| mvnDeps:
//| - com.goyeau::mill-scalafix::0.6.0
//| - com.lihaoyi::mill-contrib-buildinfo:$MILL_VERSION


import io.github.quafadas.millSite._
import os.copy.over
// import io.github.quafadas.millSite._
import mill._, scalalib._, publish._, scalanativelib._
import mill.scalalib.scalafmt.ScalafmtModule
import de.tobiasroeser.mill.vcs.version._
import mill.util.*

import com.goyeau.mill.scalafix.ScalafixModule
import java.text.Format

object V{
val scalaLts = "3.3.5"

object V{
val scalaLts = "3.3.6"
val pwV = build.pwV
val http4sVersion = "0.23.30"
val circeVersion = "0.14.10"
val scalaVersion = "3.7.2"
val laminar = "17.2.1"
val scalaJsDom = "2.8.1"
val scalaJs = "1.19.0"
}

trait FormatFix extends ScalafmtModule with ScalafixModule with ScalaModule

trait FormatFixPublish extends ScalaModule with FormatFix with PublishModule{
override def scalaVersion = "3.6.4"
override def scalaVersion = V.scalaVersion

override def scalacOptions: Target[Seq[String]] = super.scalacOptions() ++ Seq("-Wunused:all")
override def scalacOptions = super.scalacOptions() ++ Seq("-Wunused:all")

def publishVersion = VcsVersion.vcsState().format()

override def pomSettings = T {
override def pomSettings = Task {
PomSettings(
description = "An experimental live server for scala JS projects",
organization = "io.github.quafadas",
Expand All @@ -46,79 +53,33 @@ trait FormatFixPublish extends ScalaModule with FormatFix with PublishModule{

trait Testy extends TestModule.Munit with FormatFix {

override def defaultCommandName(): String = "test"
override def defaultTask(): String = "testForked"

def ivyDeps = super.ivyDeps() ++ sjsls.ivyDeps() ++ Seq(
ivy"org.typelevel::munit-cats-effect::2.0.0",
ivy"org.scalameta::munit::1.1.0",
ivy"com.lihaoyi::os-lib:0.11.4"
def mvnDeps = super.mvnDeps() ++ sjsls.mvnDeps() ++ Seq(
mvn"org.typelevel::munit-cats-effect::2.0.0",
mvn"org.scalameta::munit::1.1.0",
mvn"com.lihaoyi::os-lib:0.11.4"
)

}

object routes extends FormatFixPublish {

def scalaVersion: T[String] = V.scalaLts

def ivyDeps = Agg(
ivy"org.http4s::http4s-core:${V.http4sVersion}",
ivy"org.http4s::http4s-client:${V.http4sVersion}",
ivy"org.http4s::http4s-server:${V.http4sVersion}",
ivy"org.http4s::http4s-dsl::${V.http4sVersion}",
ivy"com.outr::scribe-cats::3.15.0"
)

override def artifactName = "frontend-routes"

object test extends Testy with ScalaTests{
def ivyDeps = super.ivyDeps() ++ sjsls.ivyDeps()
}

}

object sjsls extends FormatFixPublish {

override def scalaVersion = V.scalaLts
object SiteUnidoc extends ScalaModule, UnidocModule :
def scalaVersion = V.scalaVersion
def moduleDeps = Seq(build.sjsls, build.routes)

def ivyDeps = super.ivyDeps() ++ Seq(
ivy"org.http4s::http4s-ember-server::${V.http4sVersion}",
ivy"org.http4s::http4s-ember-client::${V.http4sVersion}",
ivy"org.http4s::http4s-scalatags::0.25.2",
ivy"io.circe::circe-core::${V.circeVersion}",
ivy"io.circe::circe-generic::${V.circeVersion}",
ivy"co.fs2::fs2-io::3.11.0",
ivy"com.lihaoyi::scalatags::0.13.1",
ivy"com.monovore::decline::2.5.0",
ivy"com.monovore::decline-effect::2.5.0",

)
def unidocDocumentTitle = Task { "Scala JS Live Server Docs" }
def unidocVersion = Some(VcsVersion.vcsState().format())

def moduleDeps = Seq(routes)

def artifactName = "sjsls"
// def scalaVersion = sjsls.scalaVersion

object test extends Testy with ScalaTests {
def ivyDeps = super.ivyDeps() ++ sjsls.ivyDeps() ++ Seq(

ivy"com.microsoft.playwright:playwright:${playwrightVersion.pwV}",
ivy"com.microsoft.playwright:driver-bundle:${playwrightVersion.pwV}"
)
}
//def scalaNativeVersion = "0.4.17" // aspirational :-)

}

object site extends SiteModule {

def scalaVersion = sjsls.scalaVersion

override def moduleDeps = Seq(sjsls)
}
// override def moduleDeps = Seq(sjsls)
// }

// SN deps which aren't yet there.
/**
1 targets failed
project.resolvedIvyDeps
project.resolvedmvnDeps
Resolution failed for 2 modules:
--------------------------------------------
com.outr:scribe-cats_native0.4_3:3.13.5
Expand Down
3 changes: 3 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,7 @@ format:
fix:
./mill __.fix

serveUnidoc:
cs launch io.github.quafadas::sjsls:0.2.8 -- --path-to-index-html C:\live-server-scala-cli-js\out\SiteUnidoc\unidocLocal.dest --build-tool none

gha: setupMill setupPlaywright test
Loading