Skip to content
Closed
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
103 changes: 81 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,37 +24,44 @@ concurrency:

jobs:
build:
name: Build and Test
name: Test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
os: [ubuntu-22.04]
scala: [2.13, 3]
java: [temurin@8, temurin@11, temurin@17]
java: [temurin@8, temurin@11, temurin@17, temurin@21]
project: [rootJS, rootJVM, rootNative]
exclude:
- scala: 3
java: temurin@11
- scala: 3
java: temurin@17
- scala: 3
java: temurin@21
- project: rootJS
java: temurin@11
- project: rootJS
java: temurin@17
- project: rootJS
java: temurin@21
- project: rootNative
java: temurin@11
- project: rootNative
java: temurin@17
- project: rootNative
java: temurin@21
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- name: Install sbt
uses: sbt/setup-sbt@v1

- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup sbt
uses: sbt/setup-sbt@v1

- name: Setup Java (temurin@8)
id: setup-java-temurin-8
if: matrix.java == 'temurin@8'
Expand Down Expand Up @@ -94,11 +101,24 @@ jobs:
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
run: sbt +update

- name: Setup Java (temurin@21)
id: setup-java-temurin-21
if: matrix.java == 'temurin@21'
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@21' && steps.setup-java-temurin-21.outputs.cache-hit == 'false'
run: sbt +update

- name: Check that workflows are up to date
run: sbt githubWorkflowCheck

- name: Check headers and formatting
if: matrix.java == 'temurin@8' && matrix.os == 'ubuntu-latest'
if: matrix.java == 'temurin@8' && matrix.os == 'ubuntu-22.04'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' headerCheckAll scalafmtCheckAll 'project /' scalafmtSbtCheck

- name: scalaJSLink
Expand All @@ -113,11 +133,11 @@ jobs:
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' test

- name: Check binary compatibility
if: matrix.java == 'temurin@8' && matrix.os == 'ubuntu-latest'
if: matrix.java == 'temurin@8' && matrix.os == 'ubuntu-22.04'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' mimaReportBinaryIssues

- name: Generate API documentation
if: matrix.java == 'temurin@8' && matrix.os == 'ubuntu-latest'
if: matrix.java == 'temurin@8' && matrix.os == 'ubuntu-22.04'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' doc

- name: Make target directories
Expand All @@ -141,18 +161,18 @@ jobs:
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu-22.04]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
- name: Install sbt
uses: sbt/setup-sbt@v1

- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup sbt
uses: sbt/setup-sbt@v1

- name: Setup Java (temurin@8)
id: setup-java-temurin-8
if: matrix.java == 'temurin@8'
Expand Down Expand Up @@ -192,6 +212,19 @@ jobs:
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
run: sbt +update

- name: Setup Java (temurin@21)
id: setup-java-temurin-21
if: matrix.java == 'temurin@21'
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@21' && steps.setup-java-temurin-21.outputs.cache-hit == 'false'
run: sbt +update

- name: Download target directories (2.13, rootJS)
uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -281,18 +314,18 @@ jobs:
if: github.event.repository.fork == false && github.event_name != 'pull_request'
strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu-22.04]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
- name: Install sbt
uses: sbt/setup-sbt@v1

- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup sbt
uses: sbt/setup-sbt@v1

- name: Setup Java (temurin@8)
id: setup-java-temurin-8
if: matrix.java == 'temurin@8'
Expand Down Expand Up @@ -332,28 +365,41 @@ jobs:
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
run: sbt +update

- name: Setup Java (temurin@21)
id: setup-java-temurin-21
if: matrix.java == 'temurin@21'
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@21' && steps.setup-java-temurin-21.outputs.cache-hit == 'false'
run: sbt +update

- name: Submit Dependencies
uses: scalacenter/sbt-dependency-submission@v2
with:
modules-ignore: spire-examples_2.13 spire-examples_3 rootjs_2.13 rootjs_3 docs_2.13 docs_3 spire-tests_sjs1_2.13 spire-tests_sjs1_3 rootjvm_2.13 rootjvm_3 rootnative_2.13 rootnative_3 spire-tests_2.13 spire-tests_3 spire-benchmark_2.13 spire-benchmark_3 spire-tests_native0.4_2.13 spire-tests_native0.4_3
modules-ignore: spire-examples_2.13 spire-examples_3 rootjs_2.13 rootjs_3 docs_2.13 docs_3 spire-tests_sjs1_2.13 spire-tests_sjs1_3 rootjvm_2.13 rootjvm_3 rootnative_2.13 rootnative_3 spire-tests_2.13 spire-tests_3 spire-benchmark_2.13 spire-benchmark_3 spire-tests_native0.5_2.13 spire-tests_native0.5_3
configs-ignore: test scala-tool scala-doc-tool test-internal

site:
name: Generate Site
strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu-22.04]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
- name: Install sbt
uses: sbt/setup-sbt@v1

- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup sbt
uses: sbt/setup-sbt@v1

- name: Setup Java (temurin@8)
id: setup-java-temurin-8
if: matrix.java == 'temurin@8'
Expand Down Expand Up @@ -393,6 +439,19 @@ jobs:
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
run: sbt +update

- name: Setup Java (temurin@21)
id: setup-java-temurin-21
if: matrix.java == 'temurin@21'
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@21' && steps.setup-java-temurin-21.outputs.cache-hit == 'false'
run: sbt +update

- name: Generate site
run: sbt docs/tlSite

Expand Down
33 changes: 24 additions & 9 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,28 @@ val header = """|***************************************************************

import scala.language.existentials

lazy val scalaCheckVersion = "1.17.0"
lazy val scalaCheckVersion = "1.18.1"

lazy val munit = "1.0.0-M7"
lazy val munitDiscipline = "2.0.0-M3"
lazy val munit = "1.1.0"
lazy val munitDiscipline = "2.0.0"

lazy val algebraVersion = "2.9.0"
lazy val catsVersion = "2.13.0"

lazy val apfloatVersion = "1.10.1"
lazy val jscienceVersion = "4.3.1"
lazy val apacheCommonsMath3Version = "3.6.1"

val Scala213 = "2.13.15"
val Scala3 = "3.2.2"
val Scala213 = "2.13.16"
val Scala3 = "3.3.5"

Global / onChangedBuildSource := ReloadOnSourceChanges

ThisBuild / tlBaseVersion := "0.18"

ThisBuild / scalaVersion := Scala213
ThisBuild / crossScalaVersions := Seq(Scala213, Scala3)
ThisBuild / githubWorkflowJavaVersions := Seq("8", "11", "17").map(JavaSpec.temurin(_))
ThisBuild / githubWorkflowJavaVersions := Seq("8", "11", "17", "21").map(JavaSpec.temurin)
ThisBuild / githubWorkflowBuildMatrixFailFast := Some(false)

ThisBuild / homepage := Some(url("https://typelevel.org/spire/"))
ThisBuild / licenses := Seq("MIT" -> url("https://opensource.org/licenses/MIT"))
Expand Down Expand Up @@ -68,6 +69,7 @@ lazy val platform = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.settings(spireSettings: _*)
.jvmSettings(commonJvmSettings: _*)
.jsSettings(commonJsSettings: _*)
.nativeSettings(commonNativeSettings*)
.dependsOn(macros, util)

lazy val macros = crossProject(JSPlatform, JVMPlatform, NativePlatform)
Expand All @@ -78,13 +80,15 @@ lazy val macros = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.settings(munitSettings: _*)
.jvmSettings(commonJvmSettings: _*)
.jsSettings(commonJsSettings: _*)
.nativeSettings(commonNativeSettings*)

lazy val util = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.crossType(CrossType.Pure)
.settings(moduleName := "spire-util")
.settings(spireSettings: _*)
.jvmSettings(commonJvmSettings: _*)
.jsSettings(commonJsSettings: _*)
.nativeSettings(commonNativeSettings*)
.dependsOn(macros)

lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform)
Expand All @@ -94,6 +98,7 @@ lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.settings(coreSettings: _*)
.jvmSettings(commonJvmSettings: _*)
.jsSettings(commonJsSettings: _*)
.nativeSettings(commonNativeSettings*)
.dependsOn(macros, platform, util)

lazy val extras = crossProject(JSPlatform, JVMPlatform, NativePlatform)
Expand All @@ -103,6 +108,7 @@ lazy val extras = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.settings(extrasSettings: _*)
.jvmSettings(commonJvmSettings: _*)
.jsSettings(commonJsSettings: _*)
.nativeSettings(commonNativeSettings*)
.dependsOn(macros, platform, util, core)

lazy val docs = project
Expand Down Expand Up @@ -133,12 +139,13 @@ lazy val laws = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.settings(spireSettings: _*)
.settings(
libraryDependencies ++= Seq(
"org.typelevel" %%% "algebra-laws" % algebraVersion,
"org.typelevel" %%% "algebra-laws" % catsVersion,
"org.scalacheck" %%% "scalacheck" % scalaCheckVersion
)
)
.jvmSettings(commonJvmSettings: _*)
.jsSettings(commonJsSettings: _*)
.nativeSettings(commonNativeSettings*)
.dependsOn(core, extras)

lazy val tests = crossProject(JSPlatform, JVMPlatform, NativePlatform)
Expand All @@ -149,6 +156,7 @@ lazy val tests = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.enablePlugins(NoPublishPlugin)
.jvmSettings(commonJvmSettings: _*)
.jsSettings(commonJsSettings: _*)
.nativeSettings(commonNativeSettings*)
.dependsOn(core, extras, laws)

lazy val benchmark: Project = project
Expand Down Expand Up @@ -178,7 +186,7 @@ lazy val buildSettings = Seq(

lazy val commonDeps = Seq(
libraryDependencies ++= Seq(
"org.typelevel" %%% "algebra" % algebraVersion
"org.typelevel" %%% "algebra" % catsVersion
)
)

Expand All @@ -190,6 +198,13 @@ lazy val commonJsSettings = Seq()

lazy val commonJvmSettings = Seq()

lazy val commonNativeSettings = Seq(
tlVersionIntroduced := Map(
"2.13" -> "0.19.0", // Next release with Scala Native 0.5.x is 0.19
"3" -> "0.19.0" // Set 0.19.0 as the new baseline and Ignore previous releases
)
)

ThisBuild / tlSiteApiUrl := Some(url("https://www.javadoc.io/doc/org.typelevel/spire_2.13/latest/spire/index.html"))

lazy val coreSettings = Seq(
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.8
sbt.version=1.10.7
9 changes: 5 additions & 4 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
val sbtTypelevelVersion = "0.7.4"
val sbtTypelevelVersion = "0.7.7"
addSbtPlugin("org.typelevel" % "sbt-typelevel" % sbtTypelevelVersion)
addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % sbtTypelevelVersion)

addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.1")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.17")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.6")

addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.17.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.18.2")
24 changes: 24 additions & 0 deletions tests/js/src/main/scala/spire/tests/Platform.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* **********************************************************************\
* * Project **
* * ______ ______ __ ______ ____ **
* * / ____/ / __ / / / / __ / / __/ (c) 2011-2021 **
* * / /__ / /_/ / / / / /_/ / / /_ **
* * /___ / / ____/ / / / __ / / __/ Erik Osheim, Tom Switzer **
* * ____/ / / / / / / / | | / /__ **
* * /_____/ /_/ /_/ /_/ |_| /____/ All rights reserved. **
* * **
* * Redistribution and use permitted under the MIT license. **
* * **
* \***********************************************************************
*/

package spire.tests

object Platform {

final val isJVM = false
final val isJS = true
final val isNative = false

}
Loading