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

Circle CI build + sbt-tpolecat plugin #67

Merged
merged 2 commits into from
May 4, 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
38 changes: 38 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Scala CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/sample-config/ for more details
#
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/openjdk:8-jdk

working_directory: ~/repo

environment:
# Customize the JVM maximum heap limit
JVM_OPTS: -Xmx3200m
SBT_OPTS: -Xms2G -Xmx4G -XX:ReservedCodeCacheSize=512m -XX:MaxMetaspaceSize=1024m
TERM: dumb

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "build.sbt" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: cat /dev/null | sbt test:compile

- save_cache:
paths:
- ~/.m2
key: v1-dependencies--{{ checksum "build.sbt" }}

# run tests!
- run: cat /dev/null | sbt buildHttp4sTracer
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
http4s-tracer
=============

[![Build Status](https://travis-ci.org/gvolpe/http4s-tracer.svg?branch=master)](https://travis-ci.org/gvolpe/http4s-tracer)
[![CircleCI](https://circleci.com/gh/gvolpe/http4s-tracer.svg?style=svg)](https://circleci.com/gh/gvolpe/http4s-tracer)
[![Gitter Chat](https://badges.gitter.im/http4s-tracer/http4s-tracer.svg)](https://gitter.im/http4s-tracer/http4s-tracer)
[![Maven Central](https://img.shields.io/maven-central/v/com.github.gvolpe/http4s-tracer_2.12.svg)](http://search.maven.org/#search%7Cga%7C1%7Chttp4s-tracer) <a href="https://typelevel.org/cats/"><img src="https://typelevel.org/cats/img/cats-badge.svg" height="40px" align="right" alt="Cats friendly" /></a>

Expand Down
26 changes: 1 addition & 25 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,6 @@ promptTheme := PromptTheme(List(
text(_ => "[http4s-tracer]", fg(64)).padRight(" λ ")
))

lazy val commonScalacOptions = Seq(
"-deprecation",
"-encoding", "UTF-8",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-language:experimental.macros",
"-unchecked",
"-Ypartial-unification",
"-Xfatal-warnings",
"-Xlint",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-value-discard",
"-Xfuture",
"-Xlog-reflective-calls",
"-Ywarn-inaccessible",
"-Ypatmat-exhaust-depth", "20",
"-Ydelambdafy:method",
"-Xmax-classfile-name", "100"
)

lazy val commonSettings = Seq(
startYear := Some(2018),
licenses += ("Apache-2.0", new URL("https://www.apache.org/licenses/LICENSE-2.0.txt")),
Expand All @@ -55,7 +32,6 @@ lazy val commonSettings = Seq(
Libraries.scalaCheck % Test
),
resolvers += "Apache public" at "https://repository.apache.org/content/groups/public/",
scalacOptions := commonScalacOptions,
scalafmtOnCompile := true,
publishTo := {
val sonatype = "https://oss.sonatype.org/"
Expand Down Expand Up @@ -163,4 +139,4 @@ lazy val microsite = project.in(file("site"))
.dependsOn(`http4s-tracer`, examples)

// CI build
addCommandAlias("buildHttp4sTracer", ";clean;+coverage;+test;tut")
addCommandAlias("buildHttp4sTracer", ";clean;+test;tut")
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
package com.github.gvolpe.tracer.http

import cats.effect.Sync
import cats.syntax.flatMap._
import com.github.gvolpe.tracer.Trace._
import com.github.gvolpe.tracer.Tracer
import com.github.gvolpe.tracer.algebra.UserAlgebra
import com.github.gvolpe.tracer.auth.{AuthTracedHttpRoute, Http4sAuthTracerDsl}
import com.github.gvolpe.tracer.model.user.Username
import io.circe.generic.auto._
import org.http4s._
import org.http4s.server.{AuthMiddleware, Router}
Expand All @@ -31,7 +33,7 @@ class AuthRoutes[F[_]: Sync: Tracer](users: UserAlgebra[Trace[F, ?]]) extends Ht

private val httpRoutes: AuthedService[String, F] = AuthTracedHttpRoute[String, F] {
case GET -> Root as user using traceId =>
Ok(user -> traceId)
users.find(Username(user)).run(traceId) >> Ok(user -> traceId)

case POST -> Root as user using traceId =>
Created(user -> traceId)
Expand Down
4 changes: 1 addition & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
resolvers += Classpaths.sbtPluginReleases
resolvers += "Typesafe Repository" at "https://repo.typesafe.com/typesafe/releases/"

addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")

addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.2.2")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.6")

addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.0")

Expand Down