Skip to content

Commit

Permalink
replaced scalatest with munit
Browse files Browse the repository at this point in the history
  • Loading branch information
lhns committed Apr 17, 2023
1 parent 93f7045 commit c6a23bf
Show file tree
Hide file tree
Showing 6 changed files with 259 additions and 229 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: publish

on:
release:
types: [published]
types: [ published ]

jobs:
publish:
Expand All @@ -11,17 +11,19 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3

- uses: actions/setup-java@v3.11.0
with:
distribution: 'adopt'
java-version: '8'
- name: Import PGP key
env:
PGP_PRIVATE_KEY: ${{ secrets.PGP_PRIVATE_KEY }}
run: gpg --import <(echo "$PGP_PRIVATE_KEY")
distribution: 'temurin'
java-version: '17'
cache: 'sbt'
gpg-private-key: ${{ secrets.PGP_PRIVATE_KEY }}

- name: Publish
env:
CI_VERSION: ${{ github.ref }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
run: sbt "; test; publishSigned; sonatypeBundleRelease"
SBT_OPTS: '-Xmx2G'
run: |
sbt "; test; sonatypeBundleClean; publishSigned; sonatypeBundleRelease"
13 changes: 9 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3

- uses: actions/setup-java@v3.11.0
with:
distribution: 'adopt'
java-version: '8'
distribution: 'temurin'
java-version: '17'
cache: 'sbt'

- name: Run tests
run: sbt "test"
env:
SBT_OPTS: '-Xmx2G'
run: sbt "; test"
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# base32check-java
[![Test Workflow](https://github.com/bitmarck-service/base32check-java/workflows/test/badge.svg)](https://github.com/bitmarck-service/base32check-java/actions?query=workflow%3Atest)

[![test](https://github.com/bitmarck-service/base32check-java/actions/workflows/test.yml/badge.svg)](https://github.com/bitmarck-service/base32check-java/actions/workflows/test.yml)
[![Release Notes](https://img.shields.io/github/release/bitmarck-service/base32check-java.svg?maxAge=3600)](https://github.com/bitmarck-service/base32check-java/releases/latest)
[![Maven Central](https://img.shields.io/maven-central/v/de.bitmarck.bms/base32check-java)](https://search.maven.org/artifact/de.bitmarck.bms/base32check-java)
[![Apache License 2.0](https://img.shields.io/github/license/bitmarck-service/base32check-scala.svg?maxAge=3600)](https://www.apache.org/licenses/LICENSE-2.0)
Expand Down
107 changes: 59 additions & 48 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,52 +1,63 @@
organization := "de.bitmarck.bms"
name := "base32check-java"
version := "0.0.2-SNAPSHOT"
ThisBuild / scalaVersion := "2.13.10"
ThisBuild / autoScalaLibrary := false
ThisBuild / crossPaths := false
ThisBuild / versionScheme := Some("early-semver")
ThisBuild / organization := "de.bitmarck.bms"
name := (root / name).value

val V = new {
val logbackClassic = "1.4.6"
val munit = "0.7.29"
}

javacOptions ++= Seq(
"-source", "1.8",
"-target", "1.8"
lazy val commonSettings: SettingsDefinition = Def.settings(
version := {
val Tag = "refs/tags/v?([0-9]+(?:\\.[0-9]+)+(?:[+-].*)?)".r
sys.env.get("CI_VERSION").collect { case Tag(tag) => tag }
.getOrElse("0.0.1-SNAPSHOT")
},

licenses += ("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0")),

homepage := Some(url("https://base32check.org")),
scmInfo := Some(
ScmInfo(
url("https://github.com/bitmarck-service/base32check-java"),
"scm:git@github.com:bitmarck-service/base32check-java.git"
)
),
developers := List(
Developer(id = "u016595", name = "Pierre Kisters", email = "pierre.kisters@bitmarck.de", url = url("https://github.com/lhns/"))
),

libraryDependencies ++= Seq(
"ch.qos.logback" % "logback-classic" % V.logbackClassic % Test,
"org.scalameta" %% "munit" % V.munit % Test,
),

testFrameworks += new TestFramework("munit.Framework"),

Compile / doc / sources := Seq.empty,

publishMavenStyle := true,

publishTo := sonatypePublishToBundle.value,

sonatypeCredentialHost := "oss.sonatype.org",

credentials ++= (for {
username <- sys.env.get("SONATYPE_USERNAME")
password <- sys.env.get("SONATYPE_PASSWORD")
} yield Credentials(
"Sonatype Nexus Repository Manager",
sonatypeCredentialHost.value,
username,
password
)).toList
)

scalaVersion := "2.13.4"
autoScalaLibrary := false
crossPaths := false

licenses += ("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0"))

homepage := Some(url("https://base32check.org"))
scmInfo := Some(
ScmInfo(
url("https://github.com/bitmarck-service/base32check-scala"),
"scm:git@github.com:bitmarck-service/base32check-scala.git"
lazy val root: Project = project.in(file("."))
.settings(commonSettings)
.settings(
name := "base32check-java"
)
)
developers := List(
Developer(id = "u016595", name = "Pierre Kisters", email = "pierre.kisters@bitmarck.de", url = url("https://github.com/lhns/"))
)

libraryDependencies ++= Seq(
"org.scalatestplus" %% "scalacheck-1-14" % "3.2.2.0" % Test,
"org.scalatest" %% "scalatest" % "3.2.15" % Test,
)


Compile / doc / sources := Seq.empty

version := {
val tagPrefix = "refs/tags/"
sys.env.get("CI_VERSION").filter(_.startsWith(tagPrefix)).map(_.drop(tagPrefix.length)).getOrElse(version.value)
}

publishMavenStyle := true

publishTo := sonatypePublishToBundle.value

credentials ++= (for {
username <- sys.env.get("SONATYPE_USERNAME")
password <- sys.env.get("SONATYPE_PASSWORD")
} yield Credentials(
"Sonatype Nexus Repository Manager",
"oss.sonatype.org",
username,
password
)).toList
Loading

0 comments on commit c6a23bf

Please sign in to comment.