8000 add CI, bump sbt to 1.6.1 by arainko · Pull Request #1 · arainko/ducktape · GitHub
[go: up one dir, main page]

Skip to content
  • 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
    21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
    8000
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    name: Continuous integration
    on:
    pull_request:
    branches: [ master ]

    jobs:
    ci:
    runs-on: ubuntu-latest
    timeout-minutes: 5
    env:
    SBT_NATIVE_CLIENT: true
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-java@v2
    with:
    distribution: temurin
    java-version: 17
    - name: Check formatting
    run: sbt scalafmtCheckAll
    - name: Run unit tests
    run: sbt test
    22 changes: 22 additions & 0 deletions .github/workflows/release.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    name: Release
    on:
    push:
    tags: ["v*"]
    jobs:
    publish:
    runs-on: ubuntu-20.04
    needs: "ci"
    steps:
    - uses: actions/checkout@v2.3.4
    with:
    fetch-depth: 0
    - uses: actions/setup-java@v2
    with:
    distribution: temurin
    java-version: 17
    - run: sbt ci-release
    env:
    PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
    PGP_SECRET: ${{ secrets.PGP_SECRET }}
    SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
    SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
    3 changes: 0 additions & 3 deletions build.sbt
    Original file line number Diff line number Diff line change
    Expand Up @@ -7,11 +7,8 @@ organization := "io.github.arainko"
    licenses := Seq("APL2" -> url("https://www.apache.org/licenses/LICENSE-2.0.txt"))
    description := "Boilerplate-free transformations"

    publishMavenStyle := true
    sonatypeProjectHosting := Some(GitHubHosting("arainko", "ducktape", "aleksander.rainko99@gmail.com"))
    sonatypeRepository := "https://s01.oss.sonatype.org/service/local"
    sonatypeCredentialHost := "s01.oss.sonatype.org"
    publishTo := sonatypePublishToBundle.value

    lazy val ducktape =
    project
    Expand Down
    2 changes: 1 addition & 1 deletion project/build.properties
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    sbt.version=1.5.5
    sbt.version=1.6.1
    4 changes: 1 addition & 3 deletions project/plugins.sbt
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,2 @@
    addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.3")
    addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
    addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")
    addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.10")
    addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.9")
    Original file line number Diff line number Diff line change
    Expand Up @@ -43,7 +43,7 @@ object BuilderMacros {

    def selectedFieldMacro[From: Type, FieldType: Type](selector: Expr[From => FieldType])(using Quotes) =
    Expr(BuilderMacros().selectedField(selector))

    def dropCompiletimeFieldMacro[
    SpecificBuilder[_, _, _ <: Tuple, _ <: Tuple, _ <: Tuple, _ <: Tuple]: Type,
    From: Type,
    Expand Down
    Original file line number Diff line number Diff line change
    Expand Up @@ -61,7 +61,7 @@ private[ducktape] object Derivation:
    inline erasedValue[FromCases] match {
    case _: EmptyTuple => Map.empty
    case _: (Case[label, tpe, ordinal] *: tail) =>
    ordinalsForMatchingSingletons[tail, ToCases] +
    ordinalsForMatchingSingletons[tail, ToCases] +
    (Ordinal(constValue[ordinal]) -> singletonWithLabel[label, tpe, ToCases])
    }

    Expand Down
    Original file line number Diff line number Diff line change
    Expand Up @@ -2,4 +2,4 @@ package io.github.arainko.ducktape.internal

    import io.github.arainko.ducktape.Transformer

    final case class RenamedField(fromField: FieldName, transformer: Transformer[Any, Any])
    final case class RenamedField(fromField: FieldName, transformer: Transformer[Any, Any])
    Original file line number Diff line number Diff line change
    Expand Up @@ -5,11 +5,11 @@ opaque type FieldName <: String = String

    object Ordinal:
    def apply(value: Int): Ordinal = value

    end Ordinal

    object FieldName:
    def apply(value: String): FieldName = value
    def wrapAll[A](map: Map[String, A]): Map[FieldName, A] = map

    end FieldName
    end FieldName
    Original file line number Diff line number Diff line change
    Expand Up @@ -50,8 +50,8 @@ class CaseSuite extends FunSuite {
    }

    test("Case.DropByType drops an element of a tuple based on its type") {
    type Expected =
    Case["Case1", Enum.Case1.type, 0] *:
    type Expected =
    Case["Case1", Enum.Case1.type, 0] *:
    Case["Case2", Enum.Case2.type, 1] *:
    Case["Case4", Enum.Case4.type, 3] *:
    Case["Case5", Enum.Case5.type, 4] *:
    Expand All @@ -65,7 +65,7 @@ class CaseSuite extends FunSuite {

    test("Case.OrdinalForType returns a compiletime ordinal for a given type") {
    type Expected = 2

    type Cases = Case.FromLabelsAndTypes[mirror.MirroredElemLabels, mirror.MirroredElemTypes]
    type Actual = Case.OrdinalForType[Enum.Case3.type, Cases]

    Expand All @@ -77,7 +77,7 @@ class CaseSuite extends FunSuite {

    type Cases = Case.FromLabelsAndTypes[mirror.MirroredElemLabels, mirror.MirroredElemTypes]
    type Actual = Case.OrdinalForType[Int, Cases]

    summon[Actual =:= Expected]
    }

    Expand Down
    Original file line number Diff line number Diff line change
    Expand Up @@ -21,7 +21,7 @@ class FieldSuite extends FunSuite {
    EmptyTuple

    type Actual = Field.FromLabelsAndTypes[mirror.MirroredElemLabels, mirror.MirroredElemTypes]

    summon[Actual =:= Expected]
    }

    Expand Down
  • 0