Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.
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
11 changes: 8 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
name: CI
on: [workflow_dispatch, push, pull_request]
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
env:
JAVA_OPTS: -Xmx4G -Xss8m -XX:+UseG1GC
steps:
- uses: actions/checkout@v4
- uses: coursier/cache-action@v6
- uses: coursier/setup-action@v1
with:
java-version: [email protected]
- uses: sbt/setup-sbt@v1
- name: Tyrian Compile & Test
run: sbt clean compile scalafmtCheckAll test
run: bash ci.sh
34 changes: 0 additions & 34 deletions .github/workflows/manual-build-all.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .jvmopts

This file was deleted.

118 changes: 118 additions & 0 deletions build.mill
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
//| mill-version: 1.0.6
//| mvnDeps: [
//| "com.goyeau::mill-scalafix::0.6.0",
//| "org.typelevel::scalac-options:0.1.8"
//| ]

package build

import mill.*
import mill.scalalib.*
import mill.scalalib.publish.*
import mill.scalalib.scalafmt.*
import mill.scalajslib.*
import mill.api.BuildCtx
import org.typelevel.scalacoptions.*
import com.goyeau.mill.scalafix.ScalafixModule

trait Shared extends ScalafmtModule, ScalafixModule:
def scalaVersion = "3.7.3"

override def scalacOptions = Task {
super.scalacOptions() ++
ScalacOptions.tokensForVersion(
ScalaVersion.unsafeFromString(scalaVersion()),
ScalacOptions.default ++ ScalacOptions.fatalWarningOptions
)
}

trait SharedJVM extends Shared, ScalaModule:
object test extends ScalaTests:
def mvnDeps = Seq(
mvn"org.scalameta::munit::1.2.0",
mvn"org.typelevel::munit-cats-effect::${Dependencies.munitCatsEffect3}",
mvn"org.typelevel::discipline-munit::${Dependencies.disciplineMUnit}",
mvn"org.typelevel::cats-laws::${Dependencies.catsLaws}"
)

def testFramework = Task("munit.Framework")

trait SharedJS extends Shared, ScalaJSModule:
def scalaJSVersion = Task("1.20.1")

object test extends ScalaJSTests:
def mvnDeps = Seq(
mvn"org.scalameta::munit::1.2.0",
mvn"org.typelevel::munit-cats-effect::${Dependencies.munitCatsEffect3}",
mvn"org.typelevel::discipline-munit::${Dependencies.disciplineMUnit}",
mvn"org.typelevel::cats-laws::${Dependencies.catsLaws}"
)

override def moduleKind = Task(mill.scalajslib.api.ModuleKind.CommonJSModule)

def testFramework = Task("munit.Framework")

trait SharedPublish extends PublishModule:

def tyrianVersion = Task.Input(TyrianVersion.getVersion(BuildCtx.workspaceRoot))

def publishVersion = tyrianVersion()

def pomSettings =
PomSettings(
description = "tyrian",
organization = "io.indigoengine",
url = "https://github.com/PurpleKingdomGames/tyrian",
licenses = Seq(License.MIT),
versionControl = VersionControl.github("PurpleKingdomGames", "tyrian"),
developers = Seq(
Developer("davesmith00000", "David Smith", "https://github.com/davesmith00000")
)
)

// --- Utils ---

object TyrianVersion:

def getVersion(workspaceDir: os.Path): String = {
def rec(wd: os.Path, file: String, levels: Int, version: Option[String]): String = {
val msg = "ERROR: Couldn't find tyrian version."
version match {
case Some(v) =>
println(s"""Tyrian version set to '$v'""")
v

case None if levels < 3 =>
try {
val v = os.read.lines(wd / file).head
rec(wd, file, levels, Some(v))
} catch {
case _: Throwable =>
rec(wd / os.RelPath.up, file, levels + 1, None)
}

case None =>
println(msg)
throw new Exception(msg)
}
}

rec(workspaceDir, ".tyrian-version", 0, None)
}

object Dependencies:

val catsEffect = "3.6.3"
val circe = "0.14.15"
val fs2 = "3.12.2"
val scalajsDomVersion = "2.8.1"
val munitCatsEffect3 = "2.1.0"
val disciplineMUnit = "2.0.0"
val scalajsSnabbdom = "0.2.0-M3"
val zio = "2.1.21"
val zioInteropCats = "23.1.0.5"
val scalaJavaTime = "2.6.0"
val catsLaws = "2.13.0"
val http4sCirce = "0.23.30"
val http4sDom = "0.2.11"
val http4sServer = "0.23.32"
Loading
Loading