Skip to content

Commit 3f2db7d

Browse files
committed
Migrate to GitHub Actions (close #185)
1 parent a3f806f commit 3f2db7d

File tree

10 files changed

+141
-98
lines changed

10 files changed

+141
-98
lines changed

.github/workflows/ci.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- develop
8+
pull_request:
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: coursier/cache-action@v6
16+
17+
- name: Set up JDK 11
18+
uses: actions/setup-java@v1
19+
with:
20+
java-version: 11
21+
22+
- name: Check Scala formatting
23+
run: sbt scalafmtCheckAll scalafmtSbtCheck
24+
25+
- name: Run tests with coverage
26+
run: sbt clean coverage test
27+
28+
- name: Check assets can be published
29+
run: sbt publishLocal
30+
31+
- name: Submit coveralls data
32+
run: sbt coverageReport coveralls
33+
env:
34+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: coursier/cache-action@v6
14+
15+
- name: Make site
16+
run: sbt makeSite
17+
18+
- name: Publish ScalaDoc
19+
uses: JamesIves/[email protected]
20+
with:
21+
branch: gh-pages
22+
folder: target/site
23+
clean: false
24+
25+
- name: Deploy to Maven Central
26+
run: sbt ci-release
27+
env:
28+
PGP_PASSPHRASE: ${{ secrets.SONA_PGP_PASSPHRASE }}
29+
PGP_SECRET: ${{ secrets.SONA_PGP_SECRET }}
30+
SONATYPE_USERNAME: ${{ secrets.SONA_USER }}
31+
SONATYPE_PASSWORD: ${{ secrets.SONA_PASS }}

.github/workflows/snyk.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Snyk
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
7+
jobs:
8+
security:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: Run Snyk to check for vulnerabilities
15+
uses: snyk/actions/scala@master
16+
with:
17+
command: monitor
18+
args: --project-name=scala-forex
19+
env:
20+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

.travis.yml

-24
This file was deleted.

.travis/deploy.sh

-24
This file was deleted.

README.md

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# Scala Forex
22

3-
[![Build Status][travis-image]][travis]
4-
[![Maven Central][maven-image]][maven-link]
3+
[![Build Status][ci-image]][ci]
4+
[![Maven Central][release-image]][releases]
5+
[![Coverage Status][coveralls-image]][coveralls]
56
[![License][license-image]][license]
6-
[![Join the chat at https://gitter.im/snowplow/scala-forex][gitter-image]][gitter-link]
7-
[![codecov](https://codecov.io/gh/snowplow/scala-forex/branch/master/graph/badge.svg)](https://codecov.io/gh/snowplow/scala-forex)
87

98
## 1. Introduction
109

@@ -402,16 +401,16 @@ limitations under the License.
402401

403402
[joda-money]: http://www.joda.org/joda-money/
404403

405-
[travis]: https://travis-ci.org/snowplow/scala-forex
406-
[travis-image]: https://travis-ci.org/snowplow/scala-forex.png?branch=master
404+
[coveralls]: https://coveralls.io/github/snowplow/scala-forex?branch=master
405+
[coveralls-image]: https://coveralls.io/repos/github/snowplow/scala-forex/badge.svg?branch=master
407406

408-
[maven-image]: https://maven-badges.herokuapp.com/maven-central/com.snowplowanalytics/scala-forex_2.12/badge.svg
409-
[maven-link]: https://maven-badges.herokuapp.com/maven-central/com.snowplowanalytics/scala-forex_2.12
407+
[ci]: https://github.com/snowplow/scala-forex/actions?query=workflow%3ACI
408+
[ci-image]: https://github.com/snowplow/scala-forex/workflows/CI/badge.svg
409+
410+
[releases]: https://maven-badges.herokuapp.com/maven-central/com.snowplowanalytics/scala-forex_2.12
411+
[release-image]: https://img.shields.io/maven-central/v/com.snowplowanalytics/scala-forex_2.12.svg
410412

411413
[license-image]: http://img.shields.io/badge/license-Apache--2-blue.svg?style=flat
412414
[license]: http://www.apache.org/licenses/LICENSE-2.0
413415

414-
[gitter-image]: https://badges.gitter.im/snowplow/scala-forex.svg
415-
[gitter-link]: https://gitter.im/snowplow/scala-forex?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
416-
417-
[scaladoc-pages]: http://snowplow.github.io/scala-forex/
416+
[scaladoc-pages]: http://snowplow.github.io/scala-forex/

build.sbt

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@
1515

1616
lazy val root = project
1717
.in(file("."))
18-
.enablePlugins(ScalaUnidocPlugin, GhpagesPlugin)
1918
.settings(
2019
name := "scala-forex",
21-
version := "1.0.0",
2220
description := "High-performance Scala library for performing currency conversions using Open Exchange Rates"
2321
)
2422
.settings(BuildSettings.buildSettings)
@@ -36,3 +34,4 @@ lazy val root = project
3634
Dependencies.Libraries.specs2Mock
3735
)
3836
)
37+
.enablePlugins(SiteScaladocPlugin, PreprocessPlugin)

project/BuildSettings.scala

+18-29
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,12 @@
1414
// SBT
1515
import sbt._
1616
import Keys._
17-
18-
// Bintray plugin
19-
import bintray.BintrayPlugin._
20-
import bintray.BintrayKeys._
17+
import com.typesafe.sbt.site.SiteScaladocPlugin.autoImport.SiteScaladoc
18+
import sbtdynver.DynVerPlugin.autoImport.dynverVTagPrefix
2119

2220
// Docs
23-
import sbtunidoc.ScalaUnidocPlugin.autoImport._
24-
import com.typesafe.sbt.site.SitePlugin.autoImport._
25-
import com.typesafe.sbt.SbtGit.GitKeys._
21+
import com.typesafe.sbt.site.SitePlugin.autoImport.siteSubdirName
22+
import com.typesafe.sbt.site.SiteScaladocPlugin.autoImport._
2623

2724
object BuildSettings {
2825

@@ -32,35 +29,27 @@ object BuildSettings {
3229
lazy val buildSettings = Seq[Setting[_]](
3330
organization := "com.snowplowanalytics",
3431
scalaVersion := "2.12.15",
35-
javacOptions := javaCompilerOptions,
32+
javacOptions := javaCompilerOptions
3633
)
3734

38-
// Publish settings
39-
lazy val publishSettings = bintraySettings ++ Seq(
40-
publishMavenStyle := true,
35+
lazy val publishSettings = Seq[Setting[_]](
4136
publishArtifact := true,
42-
publishArtifact in Test := false,
43-
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0.html")),
44-
bintrayOrganization := Some("snowplow"),
45-
bintrayRepository := "snowplow-maven",
37+
Test / publishArtifact := false,
4638
pomIncludeRepository := { _ => false },
4739
homepage := Some(url("http://snowplowanalytics.com")),
48-
scmInfo := Some(
49-
ScmInfo(url("https://github.com/snowplow/scala-forex"), "scm:[email protected]:snowplow/scala-forex.git")
50-
),
51-
pomExtra := (<developers>
52-
<developer>
53-
<name>Snowplow Analytics Ltd</name>
54-
<email>support@snowplowanalytics.com</email>
55-
<organization>Snowplow Analytics Ltd</organization>
56-
<organizationUrl>http://snowplowanalytics.com</organizationUrl>
57-
</developer>
58-
</developers>)
40+
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0.html")),
41+
ThisBuild / dynverVTagPrefix := false, // Otherwise git tags required to have v-prefix
42+
developers := List(
43+
Developer(
44+
"Snowplow Analytics Ltd",
45+
"Snowplow Analytics Ltd",
46+
47+
url("https://snowplowanalytics.com")
48+
)
49+
)
5950
)
6051

6152
lazy val docsSettings = Seq(
62-
addMappingsToSiteDir(mappings in (ScalaUnidoc, packageDoc), siteSubdirName in ScalaUnidoc),
63-
gitRemoteRepo := "https://github.com/snowplow/scala-forex.git",
64-
siteSubdirName := ""
53+
SiteScaladoc / siteSubdirName := s"${version.value}",
6554
)
6655
}

project/plugins.sbt

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.4")
2-
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")
3-
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
4-
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.3.2")
5-
addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.2")
6-
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.2")
7-
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.5")
1+
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")
2+
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.9.3")
3+
addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.1")
4+
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.3.2")
5+
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.5")
6+
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")

src/site-preprocess/index.html

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Project Documentation</title>
6+
<script language="JavaScript">
7+
<!--
8+
function doRedirect()
9+
{
10+
window.location.replace("@VERSION@");
11+
}
12+
doRedirect();
13+
//-->
14+
</script>
15+
</head>
16+
<body>
17+
<a href="@VERSION@">Go to the project documentation
18+
</a>
19+
</body>
20+
</html>

0 commit comments

Comments
 (0)