Skip to content

Commit

Permalink
add scala3
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatScalaGuy committed Nov 22, 2022
1 parent f07224e commit 4284acf
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 5 deletions.
75 changes: 74 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,16 @@ jobs:
matrix:
os: [ubuntu-latest]
scala: [2.12.17, 2.13.10, 3.2.1]
java: [temurin@8]
java: [temurin@8, temurin@11, temurin@17]
exclude:
- scala: 2.12.17
java: temurin@11
- scala: 2.12.17
java: temurin@17
- scala: 3.2.1
java: temurin@11
- scala: 3.2.1
java: temurin@17
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
Expand All @@ -53,6 +62,38 @@ jobs:
java-version: 8
jdkFile: ${{ steps.download-java-temurin-8.outputs.jdkFile }}

- name: Download Java (temurin@11)
id: download-java-temurin-11
if: matrix.java == 'temurin@11'
uses: typelevel/download-java@v1
with:
distribution: temurin
java-version: 11

- name: Setup Java (temurin@11)
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v2
with:
distribution: jdkfile
java-version: 11
jdkFile: ${{ steps.download-java-temurin-11.outputs.jdkFile }}

- name: Download Java (temurin@17)
id: download-java-temurin-17
if: matrix.java == 'temurin@17'
uses: typelevel/download-java@v1
with:
distribution: temurin
java-version: 17

- name: Setup Java (temurin@17)
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v2
with:
distribution: jdkfile
java-version: 17
jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }}

- name: Cache sbt
uses: actions/cache@v2
with:
Expand Down Expand Up @@ -130,6 +171,38 @@ jobs:
java-version: 8
jdkFile: ${{ steps.download-java-temurin-8.outputs.jdkFile }}

- name: Download Java (temurin@11)
id: download-java-temurin-11
if: matrix.java == 'temurin@11'
uses: typelevel/download-java@v1
with:
distribution: temurin
java-version: 11

- name: Setup Java (temurin@11)
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v2
with:
distribution: jdkfile
java-version: 11
jdkFile: ${{ steps.download-java-temurin-11.outputs.jdkFile }}

- name: Download Java (temurin@17)
id: download-java-temurin-17
if: matrix.java == 'temurin@17'
uses: typelevel/download-java@v1
with:
distribution: temurin
java-version: 17

- name: Setup Java (temurin@17)
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v2
with:
distribution: jdkfile
java-version: 17
jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }}

- name: Cache sbt
uses: actions/cache@v2
with:
Expand Down
15 changes: 13 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ val Scala212 = "2.12.17"
val Scala213 = "2.13.10"
val Scala3 = "3.2.1"

ThisBuild / tlBaseVersion := "1.1"
ThisBuild / tlBaseVersion := "1.2"

ThisBuild / scalaVersion := Scala213
ThisBuild / crossScalaVersions := Seq(Scala212, Scala213, Scala3)
Expand All @@ -18,11 +18,22 @@ ThisBuild / developers := List(
tlGitHubDev("ThatScalaGuy", "Sven Herrmann")
)

ThisBuild / githubWorkflowJavaVersions := Seq(
JavaSpec.temurin("8"),
JavaSpec.temurin("11"),
JavaSpec.temurin("17")
)

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

ThisBuild / tlSonatypeUseLegacyHost := false // deploy to s01.oss.sonatype.org

lazy val root = (project in file("."))
.settings(
name := "ulid4cats",
libraryDependencies ++= Seq(catsEffect, ulid4s),
libraryDependencies ++= Seq(
catsEffect,
ulid4s cross CrossVersion.for3Use2_13
),
libraryDependencies += scalaTest % Test
)
4 changes: 2 additions & 2 deletions src/main/scala/de/thatscalaguy/ulid4cats/FULID.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ trait FULID[F[_]] {
}

object FULID {
def apply[F[_]](implicit ev: FULID[F]): FULID[F] = ev
def apply[F[_]](implicit ev: FULID[F]): ev.type = ev

implicit def instance[F[_]: Sync] = new FULID[F] {
implicit def instance[F[_]: Sync]: FULID[F] = new FULID[F] {
override def generate: F[String] = Sync[F].delay(ULID.generate)

override def timeStamp(ulid: String): F[Option[Long]] =
Expand Down

0 comments on commit 4284acf

Please sign in to comment.