Skip to content
Open
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
39 changes: 24 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ concurrency:

jobs:
build:
name: Build and Test
name: Test
strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu-22.04]
scala: [3]
java: [temurin@11, temurin@17, temurin@21]
runs-on: ${{ matrix.os }}
Expand All @@ -40,6 +40,9 @@ jobs:
with:
fetch-depth: 0

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

- name: Setup Java (temurin@11)
id: setup-java-temurin-11
if: matrix.java == 'temurin@11'
Expand Down Expand Up @@ -86,20 +89,20 @@ jobs:
run: sbt '++ ${{ matrix.scala }}' test

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

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

- name: Make target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
run: mkdir -p modules/oath-circe/target modules/oath-jsoniter-scala/target modules/oath-core/target modules/oath-macros/target project/target
run: mkdir -p oath/circe/target oath/jsoniter-scala/target oath/core/target oath/macros/target project/target

- name: Compress target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
run: tar cf targets.tar modules/oath-circe/target modules/oath-jsoniter-scala/target modules/oath-core/target modules/oath-macros/target project/target
run: tar cf targets.tar oath/circe/target oath/jsoniter-scala/target oath/core/target oath/macros/target project/target

- name: Upload target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
Expand All @@ -114,7 +117,7 @@ jobs:
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu-22.04]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -123,6 +126,9 @@ jobs:
with:
fetch-depth: 0

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

- name: Setup Java (temurin@11)
id: setup-java-temurin-11
if: matrix.java == 'temurin@11'
Expand Down Expand Up @@ -198,10 +204,10 @@ jobs:

dependency-submission:
name: Submit Dependencies
if: github.event_name != 'pull_request'
if: github.event.repository.fork == false && github.event_name != 'pull_request'
strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu-22.04]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -210,6 +216,9 @@ jobs:
with:
fetch-depth: 0

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

- name: Setup Java (temurin@11)
id: setup-java-temurin-11
if: matrix.java == 'temurin@11'
Expand Down Expand Up @@ -252,14 +261,14 @@ jobs:
- name: Submit Dependencies
uses: scalacenter/sbt-dependency-submission@v2
with:
modules-ignore: oath_3
modules-ignore: oath-root_3 example_3 oath_3
configs-ignore: test scala-tool scala-doc-tool test-internal

validate-steward:
name: Validate Steward Config
strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu-22.04]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -284,8 +293,8 @@ jobs:
name: Check code style
strategy:
matrix:
os: [ubuntu-latest]
scala: [3.3.3]
os: [ubuntu-22.04]
scala: [3.3.5]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -312,8 +321,8 @@ jobs:
name: Codecov
strategy:
matrix:
os: [ubuntu-latest]
scala: [3.3.3]
os: [ubuntu-22.04]
scala: [3.3.5]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .scala-steward.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

commits.message = "chore: update ${artifactName} from ${currentVersion} to ${nextVersion}"
commits.message = "chore(deps): update ${artifactName} from ${currentVersion} to ${nextVersion}"
104 changes: 83 additions & 21 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import org.typelevel.sbt.gha.Permissions
//import org.typelevel.scalacoptions.ScalacOptions

Global / onChangedBuildSource := ReloadOnSourceChanges

ThisBuild / scalaVersion := "3.3.3"
ThisBuild / scalaVersion := "3.3.5"
ThisBuild / organization := "io.github.scala-jwt"
ThisBuild / organizationName := "oath"
ThisBuild / organizationHomepage := Some(url("https://github.com/scala-jwt/oath"))
ThisBuild / scalafixDependencies += "com.github.liancheng" %% "organize-imports" % "0.6.0"
ThisBuild / tlBaseVersion := "2.0"
ThisBuild / tlMimaPreviousVersions := Set.empty
ThisBuild / licenses := Seq(License.Apache2)
ThisBuild / developers := List(
tlGitHubDev("andrewrigas", "Andreas Rigas")
)
ThisBuild / tlSonatypeUseLegacyHost := false
ThisBuild / sonatypeCredentialHost := xerial.sbt.Sonatype.sonatypeLegacy
ThisBuild / startYear := Some(2022)
ThisBuild / githubWorkflowPermissions := Some(Permissions.WriteAll)
ThisBuild / githubWorkflowJavaVersions := Seq("11", "17", "21").map(JavaSpec.temurin)
Expand Down Expand Up @@ -50,34 +50,96 @@ ThisBuild / githubWorkflowAddedJobs ++= Seq(
),
)

lazy val root = Projects
.createModule("oath", ".")
ThisBuild / Test / fork := true
ThisBuild / run / fork := true
ThisBuild / Test / parallelExecution := false
ThisBuild / Test / testForkedParallel := true
ThisBuild / scalafmtOnCompile := sys.env.getOrElse("RUN_SCALAFMT_ON_COMPILE", "false").toBoolean
ThisBuild / scalafixOnCompile := sys.env.getOrElse("RUN_SCALAFIX_ON_COMPILE", "false").toBoolean
ThisBuild / semanticdbEnabled := true
ThisBuild / semanticdbVersion := "4.8.15"

def rootModule(rootModule: String)(subModule: Option[String]): Project =
Project(
s"$rootModule${subModule.map("-" + _).getOrElse("")}",
file(s"$rootModule${subModule.map("/" + _).getOrElse("")}"),
)

lazy val root = Project("oath-root", file("."))
.enablePlugins(NoPublishPlugin)
.settings(Aliases.all)
.aggregate(modules *)
.aggregate(allModules *)

lazy val oathMacros = Projects
.createModule("oath-macros", "modules/oath-macros")
.settings(Dependencies.oathMacros)
lazy val example = project
.in(file("example"))
.enablePlugins(NoPublishPlugin)
.dependsOn(oathCore, oathCirce, oathJsoniterScala)

lazy val oathCore = Projects
.createModule("oath-core", "modules/oath-core")
lazy val createOathModule = rootModule("oath") _

lazy val oathRoot = createOathModule(None)
.enablePlugins(NoPublishPlugin)
.aggregate(oathModules *)

lazy val oathMacros = createOathModule(Some("macros"))
.settings(
libraryDependencies ++= Seq(
Dependencies.scalaTest % Test,
Dependencies.scalaTestPlusScalaCheck % Test,
Dependencies.scalacheck % Test,
)
)

lazy val oathCore = createOathModule(Some("core"))
.dependsOn(oathMacros)
.settings(Dependencies.oathCore)
.settings(
libraryDependencies ++= Seq(
Dependencies.javaJWT,
Dependencies.typesafeConfig,
Dependencies.bcprov,
Dependencies.catsCore,
Dependencies.tink,
Dependencies.scalaTest % Test,
Dependencies.scalaTestPlusScalaCheck % Test,
Dependencies.scalacheck % Test,
Dependencies.circeCore % Test,
Dependencies.circeGeneric % Test,
Dependencies.circeParser % Test,
)
)

lazy val oathCirce = Projects
.createModule("oath-circe", "modules/oath-circe")
.settings(Dependencies.oathCirce)
.dependsOn(oathCore % "compile->compile;test->test")
lazy val oathCirce = createOathModule(Some("circe"))
.dependsOn(
oathCore,
oathCore % "test->test",
)
.settings(
libraryDependencies ++= Seq(
Dependencies.circeCore,
Dependencies.circeGeneric,
Dependencies.circeParser,
)
)

lazy val oathJsoniterScala = Projects
.createModule("oath-jsoniter-scala", "modules/oath-jsoniter-scala")
.settings(Dependencies.oathJsoniterScala)
.dependsOn(oathCore % "compile->compile;test->test")
lazy val oathJsoniterScala = createOathModule(Some("jsoniter-scala"))
.dependsOn(
oathCore,
oathCore % "test->test",
)
.settings(
libraryDependencies ++= Seq(
Dependencies.jsoniterScalacore,
Dependencies.jsoniterScalamacros,
)
)

lazy val modules: Seq[ProjectReference] = Seq(
lazy val oathModules: Seq[ProjectReference] = Seq(
oathMacros,
oathCore,
oathCirce,
oathJsoniterScala,
)

lazy val exampleModules: Seq[ProjectReference] = Seq(example)

lazy val allModules: Seq[ProjectReference] = exampleModules ++ oathModules
30 changes: 0 additions & 30 deletions modules/oath-circe/src/main/scala/io/oath/circe/syntax.scala

This file was deleted.

12 changes: 0 additions & 12 deletions modules/oath-circe/src/test/scala/io/oath/circe/Bar.scala

This file was deleted.

11 changes: 0 additions & 11 deletions modules/oath-circe/src/test/scala/io/oath/circe/Foo.scala

This file was deleted.

3 changes: 0 additions & 3 deletions modules/oath-core/src/main/scala/io/oath/Jwt.scala

This file was deleted.

17 changes: 0 additions & 17 deletions modules/oath-core/src/main/scala/io/oath/JwtClaims.scala

This file was deleted.

10 changes: 0 additions & 10 deletions modules/oath-core/src/main/scala/io/oath/JwtIssueError.scala

This file was deleted.

Loading
Loading