Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup CircleCI #4

Merged
merged 1 commit into from
May 5, 2019
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
104 changes: 104 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
version: 2.1
jobs:
lint212_jdk8:
docker:
- image: hseeberger/scala-sbt:8u181_2.12.8_1.2.8
steps:
- checkout
- restore_cache:
key: sbt-cache
- run: sbt ++2.12.8! check
- save_cache:
key: sbt-cache
paths:
- "~/.ivy2/cache"
- "~/.sbt"
- "~/.m2"
lint212_jdk11:
docker:
- image: hseeberger/scala-sbt:11.0.2_2.12.8_1.2.8
steps:
- checkout
- restore_cache:
key: sbt-cache
- run: sbt ++2.12.8! check
- save_cache:
key: sbt-cache
paths:
- "~/.ivy2/cache"
- "~/.sbt"
- "~/.m2"
test212_jdk8:
docker:
- image: hseeberger/scala-sbt:8u181_2.12.8_1.2.8
steps:
- checkout
- restore_cache:
key: sbt-cache
- run: sbt ++2.12.8! test
- save_cache:
key: sbt-cache
paths:
- "~/.ivy2/cache"
- "~/.sbt"
- "~/.m2"
test212_jdk11:
docker:
- image: hseeberger/scala-sbt:11.0.2_2.12.8_1.2.8
steps:
- checkout
- restore_cache:
key: sbt-cache
- run: sbt ++2.12.8! test
- save_cache:
key: sbt-cache
paths:
- "~/.ivy2/cache"
- "~/.sbt"
- "~/.m2"
release:
docker:
- image: hseeberger/scala-sbt:8u181_2.12.8_1.2.8
steps:
- checkout
- run: git fetch --tags
- restore_cache:
key: sbt-cache
- run: echo -n "${PGP_PUBLIC}" | base64 -d > /tmp/public.asc
- run: echo -n "${PGP_SECRET}" | base64 -d > /tmp/secret.asc
- run: sbt releaseEarly

workflows:
version: 2
build:
jobs:
- lint212_jdk8:
filters:
tags:
only: /^v[0-9]+(\.[0-9]+)*$/
- lint212_jdk11:
filters:
tags:
only: /^v[0-9]+(\.[0-9]+)*$/
- test212_jdk8:
requires:
- lint212_jdk8
filters:
tags:
only: /^v[0-9]+(\.[0-9]+)*$/
- test212_jdk11:
requires:
- lint212_jdk11
filters:
tags:
only: /^v[0-9]+(\.[0-9]+)*$/
- release:
context: Sonatype
requires:
- test212_jdk8
- test212_jdk11
filters:
branches:
ignore: /.*/
tags:
only: /^v[0-9]+(\.[0-9]+)*$/
97 changes: 79 additions & 18 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,19 +1,80 @@
lazy val root = (project in file("."))
.settings(
inThisBuild(
List(
organization := "dev.zio",
scalaVersion := "2.12.8",
version := "0.1.0-SNAPSHOT"
)
),
name := "zio-kafka",
libraryDependencies ++= Seq(
"org.apache.kafka" % "kafka-clients" % "2.2.0",
"org.scalaz" %% "scalaz-zio" % "1.0-RC4"
),
addCompilerPlugin("org.spire-math" %% "kind-projector" % "0.9.4"),
scalafmtOnCompile := true,
fork := true,
Test / fork := true
val mainScala = "2.12.8"
val allScala = Seq("2.11.12", mainScala)

organization := "dev.zio"
homepage := Some(url("https://github.com/zio/zio-kafka"))
name := "zio-kafka"
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0"))
scalaVersion := mainScala
parallelExecution in Test := false
scalafmtOnCompile := true
fork in Test := true
pgpPublicRing := file("/tmp/public.asc")
pgpSecretRing := file("/tmp/secret.asc")
releaseEarlyWith := SonatypePublisher
scmInfo := Some(
ScmInfo(url("https://github.com/zio/zio-kafka/"), "scm:git:git@github.com:zio/zio-kafka.git")
)
developers := List(
Developer(
"iravid",
"Itamar Ravid",
"iravid@iravid.com",
url("https://github.com/iravid")
)
)

libraryDependencies ++= Seq(
"org.scalaz" %% "scalaz-zio" % "1.0-RC4",
"org.apache.kafka" % "kafka-clients" % "2.2.0",
compilerPlugin("org.spire-math" %% "kind-projector" % "0.9.10")
)

scalacOptions ++= Seq(
"-deprecation",
"-encoding",
"UTF-8",
"-explaintypes",
"-Yrangepos",
"-feature",
"-Xfuture",
"-language:higherKinds",
"-language:existentials",
"-unchecked",
"-Xlint:_,-type-parameter-shadow",
"-Ywarn-numeric-widen",
"-Ywarn-unused",
"-Ywarn-value-discard"
) ++ (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 11)) =>
Seq(
"-Yno-adapted-args",
"-Ypartial-unification",
"-Ywarn-inaccessible",
"-Ywarn-infer-any",
"-Ywarn-nullary-override",
"-Ywarn-nullary-unit"
)
case Some((2, 12)) =>
Seq(
"-Xsource:2.13",
"-Yno-adapted-args",
"-Ypartial-unification",
"-Ywarn-extra-implicit",
"-Ywarn-inaccessible",
"-Ywarn-infer-any",
"-Ywarn-nullary-override",
"-Ywarn-nullary-unit",
"-opt-inline-from:<source>",
"-opt-warnings",
"-opt:l:inline"
)
case _ => Nil
})

fork in run := true

crossScalaVersions := allScala

addCommandAlias("fmt", "all scalafmtSbt scalafmt test:scalafmt")
addCommandAlias("check", "all scalafmtSbtCheck scalafmtCheck test:scalafmtCheck")
5 changes: 3 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.0.0")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.6")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.0.0")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.6")
addSbtPlugin("ch.epfl.scala" % "sbt-release-early" % "2.1.1")