Skip to content

Commit

Permalink
Merge f9f5795 into 1be9ddd
Browse files Browse the repository at this point in the history
  • Loading branch information
pondzix committed Feb 18, 2022
2 parents 1be9ddd + f9f5795 commit 928a905
Show file tree
Hide file tree
Showing 18 changed files with 297 additions and 186 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,36 @@
name: CI

on:
push:
branches:
- master
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: coursier/cache-action@v6

- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11

- name: Run tests
run: sbt coverage +test

- name: Check Scala formatting
run: sbt scalafmtCheckAll

- name: Check binary compatibility
run: sbt +mimaReportBinaryIssues

- name: Check assets can be published
run: sbt +publishLocal

- name: Submit coveralls data
run: sbt coverageReport coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,31 @@
name: RELEASE

on:
push:
tags:
- '*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: coursier/cache-action@v6

- name: Make site
run: sbt makeSite

- name: Publish ScalaDoc
uses: JamesIves/github-pages-deploy-action@v4.2.5
with:
branch: gh-pages
folder: target/site
clean: false

- name: Deploy scala-lru-map to Maven Central
run: sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.SONA_PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.SONA_PGP_SECRET }}
SONATYPE_USERNAME: ${{ secrets.SONA_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONA_PASS }}
20 changes: 20 additions & 0 deletions .github/workflows/snyk.yml
@@ -0,0 +1,20 @@
name: Snyk

on:
push:
branches: [ master ]

jobs:
security:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/scala@master
with:
command: monitor
args: --project-name=scala-lru-map
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
4 changes: 3 additions & 1 deletion .scalafmt.conf
@@ -1,7 +1,9 @@
version = 3.4.2
runner.dialect = scala213
style = defaultWithAlign
maxColumn = 100

docstrings = JavaDoc
docstrings.style = Asterisk
optIn.breakChainOnFirstMethodDot = true
spaces.afterKeywordBeforeParen = true
continuationIndent.defnSite = 2
Expand Down
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .travis/deploy.sh

This file was deleted.

21 changes: 21 additions & 0 deletions CHANGELOG
@@ -1,3 +1,24 @@
Version 0.6.0 (2022-02-16)
--------------------------
Use `cats.effect.Sync` bound on pure cache instance (#52)
Add publishing ScalaDocs (#51)
Add sbt-coveralls (#50)
Update copyright to 2022 (#49)
Add sbt-mima-plugin (#48)
Migrate from travis to github actions (#35)
Bump sbt-tpolecat to 0.1.20 (#45)
Bump sbt-scoverage to 1.9.3 (#44)
Bump sbt-ghpages to 0.6.3 (#43)
Bump sbt-site to 1.4.1 (#42)
Bump sbt-scalafmt to 2.4.6 (#41)
Remove specs2-core dependency (#39)
Bump scalacheck to 1.15.4 (#38)
Bump cats-core to 2.7.0 (#36)
Bump cats-effect to 3.3.5 (#37)
Bump sbt to 1.6.2 (#40)
Bump scala to 2.13.8, 2.12.15 (#46)
Replacement for scalacache-guava (#34)

Version 0.5.0 (2020-07-12)
--------------------------
Cherry-pick #29 from 0.3.1 (#31)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE-2.0.txt
Expand Up @@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2012 - 2020 Snowplow Analytics Ltd.
Copyright 2012 - 2022 Snowplow Analytics Ltd.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
28 changes: 20 additions & 8 deletions README.md
@@ -1,11 +1,11 @@
# Scala LruMap

[![Build Status](https://api.travis-ci.org/snowplow-incubator/scala-lru-map.svg)](https://travis-ci.org/snowplow-incubator/scala-lru-map)
[![Maven Central](https://img.shields.io/maven-central/v/com.snowplowanalytics/scala-lru-map_2.12.svg)](https://maven-badges.herokuapp.com/maven-central/com.snowplowanalytics/scala-lru-map_2.12)
[![codecov](https://codecov.io/gh/snowplow-incubator/scala-lru-map/branch/master/graph/badge.svg)](https://codecov.io/gh/snowplow-incubator/scala-lru-map)
[![Join the chat at https://gitter.im/snowplow-incubator/scala-lru-map](https://badges.gitter.im/snowplow-incubator/scala-lru-map.svg)](https://gitter.im/snowplow-incubator/scala-lru-map?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status][ci-image]][ci]
[![Maven Central][release-image]][releases]
[![Coverage Status][coveralls-image]][coveralls]
[![Join the chat at https://gitter.im/snowplow-incubator/scala-lru-map][chat-image]][chat]

A pure least recently used hash map based on [`java.util.LinkedHashMap`][linkedhashmap].
A pure least recently used map based on [`Scaffeine`][scaffeine].

## API

Expand Down Expand Up @@ -71,7 +71,7 @@ concurrency concerns are left up to the choice of `Sync`.

## Copyright and license

Copyright 2012-2020 Snowplow Analytics Ltd.
Copyright 2012-2022 Snowplow Analytics Ltd.

Licensed under the [Apache License, Version 2.0][license] (the "License");
you may not use this software except in compliance with the License.
Expand All @@ -82,7 +82,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

[linkedhashmap]: https://docs.oracle.com/javase/7/docs/api/java/util/LinkedHashMap.html
[cats-sync]: https://typelevel.org/cats-effect/typeclasses/sync.html
[scaffeine]: https://github.com/blemale/scaffeine
[cats-sync]: https://typelevel.org/cats-effect/docs/typeclasses/sync

[license]: http://www.apache.org/licenses/LICENSE-2.0

[ci]: https://github.com/snowplow-incubator/scala-lru-map/actions?query=workflow%3ACI
[ci-image]: https://github.com/snowplow-incubator/scala-lru-map/workflows/CI/badge.svg

[releases]: https://maven-badges.herokuapp.com/maven-central/com.snowplowanalytics/scala-lru-map_2.13
[release-image]: https://img.shields.io/maven-central/v/com.snowplowanalytics/scala-lru-map_2.13.svg

[coveralls]: https://coveralls.io/github/snowplow-incubator/scala-lru-map?branch=master
[coveralls-image]: https://coveralls.io/repos/github/snowplow-incubator/scala-lru-map/badge.svg?branch=master

[chat]: https://gitter.im/snowplow-incubator/scala-lru-map?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
[chat-image]: https://badges.gitter.im/snowplow-incubator/scala-lru-map.svg
25 changes: 12 additions & 13 deletions build.sbt
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2020 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2012-2022 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand All @@ -13,22 +13,21 @@
lazy val root = project
.in(file("."))
.settings(
organization := "com.snowplowanalytics",
name := "scala-lru-map",
version := "0.5.0",
description := "Simple LRU Map for caching",
scalaVersion := "2.13.2",
crossScalaVersions := Seq("2.12.10", "2.13.1"),
javacOptions := BuildSettings.javaCompilerOptions,
organization := "com.snowplowanalytics",
name := "scala-lru-map",
description := "Simple LRU Map for caching",
scalaVersion := "2.13.8",
crossScalaVersions := Seq("2.12.15", "2.13.8"),
javacOptions := BuildSettings.javaCompilerOptions,
libraryDependencies ++= Seq(
Dependencies.cats,
Dependencies.catsEffect,
Dependencies.scache,
Dependencies.scacheCats,
Dependencies.scalaCheck,
Dependencies.specs2
Dependencies.scaffeine,
Dependencies.scalaCheck
)
)
.settings(BuildSettings.publishSettings)
.settings(BuildSettings.docSettings)
.settings(BuildSettings.ghPagesSettings)
.settings(BuildSettings.coverageSettings)
.settings(BuildSettings.mimaSettings)
.enablePlugins(SiteScaladocPlugin, GhpagesPlugin, PreprocessPlugin)
96 changes: 57 additions & 39 deletions project/BuildSettings.scala
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2020 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2012-2022 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand All @@ -13,56 +13,74 @@
import sbt._
import Keys._

// Scoverage
import scoverage.ScoverageKeys._

// Bintray plugin
import bintray.BintrayPlugin._
import bintray.BintrayKeys._
// dynver plugin
import sbtdynver.DynVerPlugin.autoImport._

// Scaladocs
import sbtunidoc.ScalaUnidocPlugin.autoImport._
import com.typesafe.sbt.site.SitePlugin.autoImport._
import com.typesafe.sbt.SbtGit.GitKeys._
// Mima plugin
import com.typesafe.tools.mima.plugin.MimaKeys._

// Scoverage
import scoverage.ScoverageKeys._

// GHPages plugin
import com.typesafe.sbt.sbtghpages.GhpagesPlugin.autoImport._
import com.typesafe.sbt.site.SitePlugin.autoImport.{makeSite, siteSubdirName}
import com.typesafe.sbt.SbtGit.GitKeys.{gitBranch, gitRemoteRepo}
import com.typesafe.sbt.site.SiteScaladocPlugin.autoImport._
import com.typesafe.sbt.site.preprocess.PreprocessPlugin.autoImport._

object BuildSettings {

lazy val publishSettings = bintraySettings ++ Seq(
publishMavenStyle := true,
publishArtifact := true,
publishArtifact in Test := false,
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0.html")),
bintrayOrganization := Some("snowplow"),
bintrayRepository := "snowplow-maven",
pomIncludeRepository := { _ => false },
homepage := Some(url("https://github.com/snowplow-incubator/scala-lru-map")),
scmInfo := Some(ScmInfo(url("https://github.com/snowplow-incubator/scala-lru-map"),
"scm:git@github.com:snowplow-incubator/scala-lru-map.git")),
pomExtra := (
<developers>
<developer>
<name>Snowplow Analytics Ltd</name>
<email>support@snowplowanalytics.com</email>
<organization>Snowplow Analytics Ltd</organization>
<organizationUrl>http://snowplowanalytics.com</organizationUrl>
</developer>
</developers>)
lazy val publishSettings = Seq[Setting[_]](
publishArtifact := true,
Test / publishArtifact := false,
pomIncludeRepository := { _ => false },
homepage := Some(url("http://snowplowanalytics.com")),
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0.html")),
ThisBuild / dynverVTagPrefix := false, // Otherwise git tags required to have v-prefix
developers := List(
Developer(
"Snowplow Analytics Ltd",
"Snowplow Analytics Ltd",
"support@snowplowanalytics.com",
url("https://snowplowanalytics.com")
)
)
)
lazy val javaCompilerOptions = Seq("-source", "11", "-target", "11")

lazy val docSettings = Seq(
gitRemoteRepo := "https://github.com/snowplow-incubator/scala-lru-map.git",
siteSubdirName := ""
lazy val coverageSettings = Seq(
coverageMinimumStmtTotal := 90,
coverageFailOnMinimum := false,
(Test / test) := {
(coverageReport dependsOn (Test / test)).value
}
)

lazy val javaCompilerOptions = Seq(
"-source", "1.8",
"-target", "1.8"
// If a new version introduces breaking changes,
// clear `mimaBinaryIssueFilters` and `mimaPreviousVersions`.
// Otherwise, add previous version to the set without
// removing older versions.
lazy val mimaPreviousVersions = Set()
lazy val mimaSettings = Seq(
mimaPreviousArtifacts := mimaPreviousVersions.map { organization.value %% name.value % _ },
ThisBuild / mimaFailOnNoPrevious := false,
mimaBinaryIssueFilters ++= Seq(),
Test / test := {
mimaReportBinaryIssues.value
(Test / test).value
}
)

lazy val coverageSettings = Seq(
coverageMinimum := 90
lazy val ghPagesSettings = Seq(
ghpagesPushSite := (ghpagesPushSite dependsOn makeSite).value,
ghpagesNoJekyll := false,
gitRemoteRepo := "https://github.com/snowplow-incubator/scala-lru-map.git",
gitBranch := Some("gh-pages"),
SiteScaladoc / siteSubdirName := s"${version.value}",
Preprocess / preprocessVars := Map("VERSION" -> version.value),
ghpagesCleanSite / excludeFilter := new FileFilter {
def accept(f: File) = true
}
)
}

0 comments on commit 928a905

Please sign in to comment.