Skip to content

Commit

Permalink
Close #94 - Use GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-lee committed Oct 22, 2019
1 parent aea932e commit f3da2d2
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 15 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build All

on: [push]

jobs:

build_scala2_10:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Build for Scala 2.10
run: .github/workflows/sbt-build-simple.sh 2.10.7

build_scala2_12:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Build for Scala 2.12
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: .github/workflows/sbt-build.sh 2.12.10
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release

on:
push:
tags:
- '*'

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: sbt ^test and ^packagedArtifacts
env:
CI_BRANCH: ${GITHUB_REF#refs/heads/}
GITHUB_TOKEN: ${{ secrets.GITHUB_AUTH_TOKEN }}
run: |
echo "Run] sbt GitHub release"
echo 'sbt -J-Xmx2048m "; clean; ^test; ^packagedArtifacts"'
sbt -J-Xmx2048m "; clean; ^test; ^packagedArtifacts"
- name: sbt Publish
env:
CI_BRANCH: ${GITHUB_REF#refs/heads/}
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_PASS: ${{ secrets.BINTRAY_PASS }}
run: |
echo "Run] sbt GitHub release"
echo 'sbt -J-Xmx2048m "; clean; ^publish"'
sbt -J-Xmx2048m "; clean; ^publish"
26 changes: 26 additions & 0 deletions .github/workflows/sbt-build-simple.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash -e

set -x

if [ -z "$1" ]
then
echo "Scala version is missing. Please enter the Scala version."
echo "sbt-build-simple.sh 2.11.12"
else
scala_version=$1
echo "============================================"
echo "Build projects (Simple)"
echo "--------------------------------------------"
echo ""
CURRENT_BRANCH_NAME="${GITHUB_REF#refs/heads/}"
if [[ "$CURRENT_BRANCH_NAME" == "master" || "$CURRENT_BRANCH_NAME" == "release" ]]
then
sbt -J-Xmx2048m "; ++ ${scala_version}; clean; test; packagedArtifacts"
else
sbt -J-Xmx2048m "; ++ ${scala_version}; clean; test; package"
fi

echo "============================================"
echo "Building projects (Simple): Done"
echo "============================================"
fi
31 changes: 31 additions & 0 deletions .github/workflows/sbt-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash -e

set -x

if [ -z "$1" ]
then
echo "Scala version is missing. Please enter the Scala version."
echo "sbt-build.sh 2.11.12"
else
scala_version=$1
echo "============================================"
echo "Build projects"
echo "--------------------------------------------"
echo ""
CURRENT_BRANCH_NAME="${GITHUB_REF#refs/heads/}"
export CI_BRANCH=$CURRENT_BRANCH_NAME
if [[ "$CURRENT_BRANCH_NAME" == "master" || "$CURRENT_BRANCH_NAME" == "release" ]]
then
sbt -J-Xmx2048m "; ++ ${scala_version}; clean; coverage; test; coverageReport; coverageAggregate"
sbt -J-Xmx2048m "; ++ ${scala_version}; coveralls"
sbt -J-Xmx2048m "; ++ ${scala_version}; clean; packagedArtifacts"
else
sbt -J-Xmx2048m "; ++ ${scala_version}; clean; coverage; test; coverageReport; coverageAggregate; package"
sbt -J-Xmx2048m "; ++ ${scala_version}; coveralls"
fi


echo "============================================"
echo "Building projects: Done"
echo "============================================"
fi
5 changes: 1 addition & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ lazy val root = (project in file("."))
, wartremoverErrors in (Compile, compile) ++= commonWarts
, wartremoverErrors in (Test, compile) ++= commonWarts
, resolvers += Deps.hedgehogRepo
, addCompilerPlugin("org.typelevel" % "kind-projector" % "0.10.1" cross CrossVersion.binary)
, addCompilerPlugin("org.typelevel" % "kind-projector" % "0.11.0" cross CrossVersion.full)
, libraryDependencies ++=
crossVersionProps(
Seq(
Expand All @@ -57,9 +57,6 @@ lazy val root = (project in file("."))
}
, testFrameworks ++= Seq(TestFramework("hedgehog.sbt.Framework"))

// , addSbtPlugin(Deps.wartRemover)
// , addSbtPlugin(Deps.scoverage)
// , addSbtPlugin(Deps.bintray)
, licenses += ("MIT", url("http://opensource.org/licenses/MIT"))
, publishMavenStyle := false

Expand Down
13 changes: 2 additions & 11 deletions project/Deps.scala
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import sbt._

object Deps {
val hedgehogVersion: String = "f120baa58d2362761de3d03512ccd5d0199f07fc"
val hedgehogVersion: String = "6dba7c9ba065e423000e9aa2b6981ce3d70b74cb"

val hedgehogRepo: Resolver =
Resolver.url(
"bintray-scala-hedgehog",
url("https://dl.bintray.com/hedgehogqa/scala-hedgehog")
)(Resolver.ivyStylePatterns)
"bintray-scala-hedgehog" at "https://dl.bintray.com/hedgehogqa/scala-hedgehog"

val hedgehogLibs: Seq[ModuleID] = Seq(
"hedgehog" %% "hedgehog-core" % hedgehogVersion % Test
Expand All @@ -19,12 +16,6 @@ object Deps {

val commonsIo: ModuleID = "commons-io" % "commons-io" % "2.1"

val wartRemover: ModuleID = "org.wartremover" % "sbt-wartremover" % "2.2.1"

val scoverage: ModuleID = "org.scoverage" % "sbt-scoverage" % "1.5.1"

val bintray: ModuleID = "org.foundweekends" % "sbt-bintray" % "0.5.4"

val githubApi: ModuleID = "org.kohsuke" % "github-api" % "1.95"

val javaxActivation210: List[ModuleID] = List(
Expand Down

0 comments on commit f3da2d2

Please sign in to comment.