Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop scala 2.11 #644

Merged
merged 5 commits into from
Jan 24, 2025
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
87 changes: 54 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,24 @@ concurrency:

jobs:
build:
name: Build and Test
name: Test
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.11, 2.12, 2.13, 3]
os: [ubuntu-22.04]
scala: [2.12, 2.13, 3]
java: [temurin@8]
project: [rootJS, rootJVM, rootNative]
exclude:
- project: rootJS
scala: 2.11
- project: rootNative
scala: 2.11
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 All @@ -64,7 +59,7 @@ jobs:
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 @@ -79,11 +74,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 @@ -107,18 +102,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 All @@ -132,16 +127,6 @@ jobs:
if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
run: sbt +update

- name: Download target directories (2.11, rootJVM)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.11-rootJVM

- name: Inflate target directories (2.11, rootJVM)
run: |
tar xf targets.tar
rm targets.tar

- name: Download target directories (2.12, rootJS)
uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -256,11 +241,47 @@ jobs:
SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }}
run: sbt tlCiRelease

dependency-submission:
name: Submit Dependencies
if: github.event.repository.fork == false && github.event_name != 'pull_request'
strategy:
matrix:
os: [ubuntu-22.04]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
- 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'
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
cache: sbt

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

- name: Submit Dependencies
uses: scalacenter/sbt-dependency-submission@v2
with:
modules-ignore: rootjs_2.12 rootjs_2.13 rootjs_3 docs_2.12 docs_2.13 docs_3 rootjvm_2.12 rootjvm_2.13 rootjvm_3 rootnative_2.12 rootnative_2.13 rootnative_3 bench_2.12 bench_2.13 bench_3
configs-ignore: test scala-tool scala-doc-tool test-internal

coverage:
name: Generate coverage report
strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu-22.04]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -288,18 +309,18 @@ jobs:
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
52 changes: 9 additions & 43 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import com.typesafe.tools.mima.core._
import Dependencies._
val scala211 = "2.11.12"
val scala212 = "2.12.20"
val scala213 = "2.13.14"
val scala213 = "2.13.15"
val scala3 = "3.3.4"

GlobalScope / tlCommandAliases ++= Map(
Expand All @@ -18,18 +17,11 @@ ThisBuild / tlMimaPreviousVersions ++= (0 to 10).map(x => s"0.3.$x").toSet
ThisBuild / startYear := Some(2021)
ThisBuild / developers += tlGitHubDev("johnynek", "P. Oscar Boykin")

ThisBuild / crossScalaVersions := List(scala211, scala212, scala213, scala3)
ThisBuild / crossScalaVersions := List(scala212, scala213, scala3)
ThisBuild / scalaVersion := scala213

ThisBuild / tlVersionIntroduced := Map("3" -> "0.3.4")

ThisBuild / tlCiDependencyGraphJob := false // omit after dropping scala 2.11
ThisBuild / githubWorkflowBuildMatrixExclusions ++=
Seq(
MatrixExclude(Map("project" -> "rootJS", "scala" -> "2.11")),
MatrixExclude(Map("project" -> "rootNative", "scala" -> "2.11"))
)

ThisBuild / githubWorkflowAddedJobs ++= Seq(
WorkflowJob(
id = "coverage",
Expand Down Expand Up @@ -58,42 +50,19 @@ lazy val root = tlCrossRootProject.aggregate(core, bench)
lazy val docs =
project.in(file("site")).enablePlugins(TypelevelSitePlugin).dependsOn(core.jvm, bench)

lazy val isScala211 = Def.setting {
scalaBinaryVersion.value == "2.11"
}

lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.crossType(CrossType.Full)
.settings(
name := "cats-parse",
libraryDependencies ++= {
if (isScala211.value)
Seq(
cats211.value,
munit211.value % Test,
munitScalacheck211.value % Test
)
else
Seq(
cats.value,
munit.value % Test,
munitScalacheck.value % Test
)
},
libraryDependencies ++=
Seq(
cats.value,
munit.value % Test,
munitScalacheck.value % Test
),
libraryDependencies ++= {
if (tlIsScala3.value) Nil else Seq("org.scala-lang" % "scala-reflect" % scalaVersion.value)
},
scalacOptions ++= {
// this code seems to trigger a bug in 2.11 pattern analysis
if (isScala211.value) List("-Xno-patmat-analysis") else Nil
},
tlFatalWarnings := {
if (isScala211.value) false
else tlFatalWarnings.value
},
mimaPreviousArtifacts := {
if (isScala211.value) Set.empty else mimaPreviousArtifacts.value
},
mimaBinaryIssueFilters ++= {
/*
* It is okay to filter anything in Impl or RadixNode which are private
Expand All @@ -111,15 +80,12 @@ lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform)
)
.jvmSettings(
// We test against jawn on JVM for some json parsers
libraryDependencies +=
(if (isScala211.value) jawnAst211.value else jawnAst.value) % Test
libraryDependencies += jawnAst.value % Test
)
.jsSettings(
crossScalaVersions := (ThisBuild / crossScalaVersions).value.filterNot(_.startsWith("2.11")),
coverageEnabled := false
)
.nativeSettings(
crossScalaVersions := (ThisBuild / crossScalaVersions).value.filterNot(_.startsWith("2.11")),
// cats-parse 1.0.1 switches to Scala Native 0.5, reset tlVersionIntroduced
tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "1.0.1").toMap,
coverageEnabled := false
Expand Down
4 changes: 0 additions & 4 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@ import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._

object Dependencies {
lazy val cats = Def.setting("org.typelevel" %%% "cats-core" % "2.12.0")
lazy val cats211 = Def.setting("org.typelevel" %%% "cats-core" % "2.0.0")
lazy val munit = Def.setting("org.scalameta" %%% "munit" % "1.0.4")
lazy val munit211 = Def.setting("org.scalameta" %%% "munit" % "1.0.0-M10")
lazy val munitScalacheck = Def.setting("org.scalameta" %%% "munit-scalacheck" % "1.0.0")
lazy val munitScalacheck211 = Def.setting("org.scalameta" %%% "munit-scalacheck" % "1.0.0-M10")
lazy val fastParse = "com.lihaoyi" %% "fastparse" % "3.1.1"
lazy val parsley = "org.http4s" %% "parsley" % "1.5.0-M3"
lazy val jawnAst = Def.setting("org.typelevel" %% "jawn-ast" % "1.6.0")
lazy val jawnAst211 = Def.setting("org.typelevel" %% "jawn-ast" % "1.0.0-RC2")
lazy val parboiled = "org.parboiled" %% "parboiled" % "2.5.1"
lazy val attoCore = "org.tpolecat" %% "atto-core" % "0.9.5"
}
6 changes: 3 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.6")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.17.0")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.2.0")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.2.2")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7")
addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.7.4")
addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % "0.7.4")
addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.7.7")
addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % "0.7.7")
Loading