diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 3da69ab..d723294 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -11,6 +11,10 @@ on: - series/** - feature/** +permissions: + contents: read + checks: write + jobs: build: runs-on: ubuntu-latest @@ -30,18 +34,18 @@ jobs: - name: Install sbt uses: sbt/setup-sbt@v1 - name: ⚙️ Run build - run: sbt ++${{ matrix.scala }} build + run: sbt "++${{ matrix.scala }}; build" - name: Publish Test Report uses: mikepenz/action-junit-report@v6 if: always() with: - report_paths: "**/target/test-reports/*.xml" + report_paths: &testReportPath "**/target/**/test-reports/*.xml" require_tests: true check_name: "${{ matrix.java }}-${{ matrix.scala }}-${{ matrix.project }}" - name: Create Test Summary uses: test-summary/action@v2 with: - paths: "**/target/test-reports/*.xml" + paths: *testReportPath if: always() - name: Code Coverage uses: codecov/codecov-action@v7 diff --git a/build.sbt b/build.sbt index 3d152e7..58db8c0 100644 --- a/build.sbt +++ b/build.sbt @@ -1,41 +1,39 @@ -import org.jetbrains.sbt.kotlin.Keys._ +import org.jetbrains.sbt.kotlin.Keys.* -inThisBuild( - Seq( - organization := "com.github.simy4.coregex", - organizationName := "Alex Simkin", - homepage := Some(url("https://github.com/SimY4/coregex")), - licenses += ("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0.txt")), - scmInfo := Some( - ScmInfo( - url("https://github.com/SimY4/coregex"), - "scm:git@github.com:SimY4/coregex.git" - ) - ), - developers := List( - Developer( - id = "SimY4", - name = "Alex Simkin", - email = null, - url = url("https://github.com/SimY4") - ) - ), - releaseNotesURL := Some(url("https://github.com/SimY4/coregex/releases")), - versionScheme := Some("early-semver"), - startYear := Some(2021), - headerEndYear := Some(2026) +organization := "com.github.simy4.coregex" +organizationName := "Alex Simkin" +homepage := Some(uri("https://github.com/SimY4/coregex")) +licenses += ("Apache-2.0", uri("https://www.apache.org/licenses/LICENSE-2.0.txt")) +scmInfo := Some( + ScmInfo( + uri("https://github.com/SimY4/coregex"), + "scm:git@github.com:SimY4/coregex.git" + ) +) +developers := List( + Developer( + id = "SimY4", + name = "Alex Simkin", + email = null, + url = uri("https://github.com/SimY4") ) ) +releaseNotesURL := Some(uri("https://github.com/SimY4/coregex/releases")) +versionScheme := Some("early-semver") +startYear := Some(2021) +headerEndYear := Some(2026) lazy val scala212 = "2.12.21" lazy val scala213 = "2.13.18" lazy val scala3 = "3.3.8" lazy val supportedScalaVersions = List(scala212, scala213, scala3) +scalaVersion := scala213 + def javaLibSettings(release: Int) = Seq( - crossPaths := false, - autoScalaLibrary := false, - ThisBuild / javafmtFormatterCompatibleJavaVersion := 17, + crossPaths := false, + autoScalaLibrary := false, + javafmtFormatterCompatibleJavaVersion := 17, Compile / compile / javacOptions ++= Seq("-Xlint:all,-options", "-Werror", "--release", release.toString), Compile / doc / javacOptions ++= Seq("-Xdoclint:all,-missing", "--release", release.toString, "-html5") ) @@ -54,28 +52,16 @@ lazy val jacocoSettings = Test / jacocoReportSettings := JacocoReportSettings( "utf-8" ) -ThisBuild / scalaVersion := scala213 - releaseTagComment := s"[sbt release] - releasing ${(ThisBuild / version).value}" releaseCommitMessage := s"[sbt release] - setting version to ${(ThisBuild / version).value}" releaseNextCommitMessage := s"[skip ci][sbt release] - new version commit: ${(ThisBuild / version).value}" -lazy val root = (project in file(".")) +lazy val root = (project in file(".")).autoAggregate .settings( - name := "coregex-parent", - publish / skip := true - ) - .aggregate( - core, - functionaljavaQuickcheck, - hedgehog, - jetCheck, - jqwik, - junitQuickcheck, - kotest, - scalacheck, - vavrTest, - zioTest + name := "coregex-parent", + publish / skip := true, + Test / skip := true, + crossScalaVersions := Nil ) lazy val core = (project in file("core")) @@ -97,8 +83,8 @@ lazy val functionaljavaQuickcheck = (project in file("functionaljava-quickcheck" moduleName := "coregex-functionaljava-quickcheck", description := "Functionaljava quickcheck bindings for coregex library.", libraryDependencies ++= Seq( - "org.functionaljava" % "functionaljava-quickcheck" % "5.0" % Provided exclude ("junit", "junit"), - "com.github.sbt" % "junit-interface" % "0.13.3" % Test + ("org.functionaljava" % "functionaljava-quickcheck" % "5.0" % Provided).exclude("junit", "junit"), + "com.github.sbt" % "junit-interface" % "0.13.3" % Test ), testOptions += Tests.Argument(TestFrameworks.JUnit, "-q", "-v"), javaLibSettings(8), @@ -163,7 +149,7 @@ lazy val junitQuickcheck = (project in file("junit-quickcheck")) moduleName := "coregex-junit-quickcheck", description := "JUnit Quickcheck bindings for coregex library.", libraryDependencies ++= Seq( - "com.pholser" % "junit-quickcheck-core" % "1.0" % Provided exclude ("junit", "junit"), + ("com.pholser" % "junit-quickcheck-core" % "1.0" % Provided).exclude("junit", "junit"), "com.pholser" % "junit-quickcheck-generators" % "1.0" % Test, "org.slf4j" % "slf4j-simple" % "1.7.25" % Test, "com.github.sbt" % "junit-interface" % "0.13.3" % Test diff --git a/project/build.properties b/project/build.properties index 144fdb6..2069c8f 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version = 1.12.13 +sbt.version = 2.0.2