Skip to content

Commit

Permalink
remove sbt-site, update plugins and remove last package object (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
fgrutsch authored Oct 7, 2022
1 parent 5d3134d commit 825c20d
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 45 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Check that workflows are up to date
run: sbt ++${{ matrix.scala }} githubWorkflowCheck

- run: sbt ++${{ matrix.scala }} codeVerify +test
- run: sbt ++${{ matrix.scala }} codeVerify test

- name: Compress target directories
run: tar cf targets.tar target core/target project/target
Expand Down Expand Up @@ -132,7 +132,7 @@ jobs:
run: sbt ++${{ matrix.scala }} ci-release

- name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
Expand All @@ -142,11 +142,10 @@ jobs:

- name: Generate documentation
if: startsWith(github.ref, 'refs/tags/v')
run: sbt docs/makeSite
run: sbt docs/paradox

- name: Publish gh-pages
if: startsWith(github.ref, 'refs/tags/v')
uses: JamesIves/github-pages-deploy-action@4.1.6
uses: JamesIves/github-pages-deploy-action@4.4.0
with:
branch: gh-pages
folder: docs/target/site
folder: docs/target/paradox/site/main
4 changes: 2 additions & 2 deletions .github/workflows/scala-steward.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will launch at 00:00 every Sunday
# This workflow will launch at 00:00 every Sunday and Wednesday
on:
schedule:
- cron: '0 0 * * 0'
- cron: '0 0 * * 0,3'
workflow_dispatch:

name: Launch Scala Steward
Expand Down
4 changes: 0 additions & 4 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,5 @@ version = "3.5.9"
runner.dialect = "scala3"
preset = defaultWithAlign
danglingParentheses.preset = false
rewrite.rules = [
AsciiSortImports,
SortModifiers
]
maxColumn = 120
docstrings.style = AsteriskSpace
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ lazy val docs = project
githubWorkflowArtifactUpload := false
)
.dependsOn(core)
.enablePlugins(ParadoxSitePlugin)
.enablePlugins(ParadoxPlugin)
16 changes: 0 additions & 16 deletions core/src/test/scala/testutil/package.scala

This file was deleted.

14 changes: 14 additions & 0 deletions core/src/test/scala/testutil/src.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package testutil

import cats.data.Kleisli
import cats.effect.{IO, Ref}

type Eff[A] = Kleisli[IO, Ref[IO, TestState], A]

extension [A](fa: Eff[A]) {
def runA(state: TestState): IO[A] =
Ref[IO].of(state).flatMap(fa.run)

def runS(state: TestState): IO[TestState] =
Ref[IO].of(state).flatMap(ref => fa.run(ref) >> ref.get)
}
6 changes: 3 additions & 3 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import sbt._

object Dependencies {

private val circeVersion = "0.14.1"
private val circeVersion = "0.14.3"
private val fs2Version = "3.3.0"
private val sttpClientVersion = "3.8.2"

val core: Seq[ModuleID] = Seq(
"ch.qos.logback" % "logback-classic" % "1.4.1",
"ch.qos.logback" % "logback-classic" % "1.4.3",
"co.fs2" %% "fs2-io" % fs2Version,
"co.fs2" %% "fs2-core" % fs2Version,
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-yaml" % "2.13.4",
Expand All @@ -18,7 +18,7 @@ object Dependencies {
"com.typesafe" % "config" % "1.4.2",
"io.circe" %% "circe-core" % circeVersion,
"io.circe" %% "circe-parser" % circeVersion,
"io.circe" %% "circe-yaml" % circeVersion,
"io.circe" %% "circe-yaml" % "0.14.1",
"org.scalatest" %% "scalatest" % "3.2.14" % Test,
"org.typelevel" %% "cats-effect" % "3.3.14",
"org.typelevel" %% "log4cats-slf4j" % "2.5.0"
Expand Down
10 changes: 5 additions & 5 deletions project/SetupGithubActionsPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ object SetupGithubActionsPlugin extends AutoPlugin {
override def buildSettings: Seq[Setting[_]] = Seq(
githubWorkflowTargetTags ++= Seq("v*"),
githubWorkflowJavaVersions += JavaSpec.temurin("17"),
githubWorkflowBuild := Seq(WorkflowStep.Sbt(List("codeVerify", "+test"))),
githubWorkflowBuild := Seq(WorkflowStep.Sbt(List("codeVerify", "test"))),
githubWorkflowPublish := Seq(WorkflowStep.Sbt(List("ci-release"))),
githubWorkflowPublishTargetBranches += RefPredicate.StartsWith(Ref.Tag("v")),
githubWorkflowPublish := Seq(
Expand All @@ -26,21 +26,21 @@ object SetupGithubActionsPlugin extends AutoPlugin {
),
githubWorkflowPublishPostamble ++= List(
WorkflowStep.Use(
UseRef.Public("docker", "login-action", "v1"),
UseRef.Public("docker", "login-action", "v2"),
name = Some("Login to Docker Hub"),
params = Map("username" -> "${{ secrets.DOCKER_USERNAME }}", "password" -> "${{ secrets.DOCKER_TOKEN }}")
),
WorkflowStep.Run(List("sbt core/docker:publish"), name = Some("Publish docker image")),
WorkflowStep.Run(
List("sbt docs/makeSite"),
List("sbt docs/paradox"),
name = Some("Generate documentation"),
cond = Some("startsWith(github.ref, 'refs/tags/v')")
),
WorkflowStep.Use(
UseRef.Public("JamesIves", "github-pages-deploy-action", "4.1.6"),
UseRef.Public("JamesIves", "github-pages-deploy-action", "4.4.0"),
name = Some("Publish gh-pages"),
cond = Some("startsWith(github.ref, 'refs/tags/v')"),
params = Map("branch" -> "gh-pages", "folder" -> "docs/target/site")
params = Map("folder" -> "docs/target/paradox/site/main")
)
)
)
Expand Down
16 changes: 8 additions & 8 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.3")
addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.14.2")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10")
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.9")
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.4.1")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.7.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.0")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.3")
addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.14.2")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10")
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.11")
addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % "0.10.2")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.7.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.4")

0 comments on commit 825c20d

Please sign in to comment.