Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

Utilise GitHub actions instead of CircleCI #27

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
41 changes: 0 additions & 41 deletions .circleci/config.yml

This file was deleted.

19 changes: 19 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
version: 2
checks:
identical-code:
config:
threshold: 25
similar-code:
config:
threshold: 60
plugins:
duplication:
enabled: true
config:
languages:
scala:
scalastyle:
enabled: true
fixme:
enabled: true
59 changes: 59 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: CI
on:
push:

jobs:
build:
strategy:
fail-fast: false
matrix:
scala: ["2.12.10", "2.11.12"]

runs-on: ubuntu-latest

env:
CC_TEST_REPORTER_ID: ${{ secrets.CODECOV_SECRET }}
SCALA_VERSION: ${{ matrix.scala }}

steps:
- uses: olafurpg/setup-scala@v7
- uses: actions/checkout@v2
with:
fetch-depth: 1

- name: Cache Coursier cache
uses: actions/[email protected]
with:
path: ~/.coursier
key: ${{ runner.os }}-sbt-coursier-cache-${{ matrix.scala }}-${{ hashFiles(format('{0}/{1}', github.workspace, 'project/Dependencies.scala')) }}

- name: Cache SBT Ivy2 cache
uses: actions/[email protected]
with:
path: ~/.ivy2
key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles(format('{0}/{1}', github.workspace, 'project/Dependencies.scala')) }}-${{ matrix.scala }}

- name: Cache SBT
uses: actions/[email protected]
with:
path: ~/.sbt
key: ${{ runner.os }}-sbt-sbt-cache-${{ hashFiles(format('{0}/{1}', github.workspace, 'project/Dependencies.scala')) }}-${{ matrix.scala }}

- name: Install CodeClimate coverage harness
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter;
chmod +x ./cc-test-reporter;
./cc-test-reporter before-build;

- name: Compile
run: sbt ++${{ matrix.scala }} compile

- name: Test
id: test
run: sbt ++${{ matrix.scala }} coverage test coverageReport coverageAggregate;

- name: Send coverage data
run: |
export SCALA_BINARY="${SCALA_VERSION:0:4}";
./cc-test-reporter format-coverage -d -t cobertura ./target/scala-$SCALA_BINARY/coverage-report/cobertura.xml && \
./cc-test-reporter upload-coverage -d;
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Lighthouse
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/be.dataminded/lighthouse_2.11/badge.svg)](https://maven-badges.herokuapp.com/maven-central/be.dataminded/lighthouse)
[![CircleCI](https://circleci.com/gh/datamindedbe/lighthouse.svg?style=svg)](https://circleci.com/gh/datamindedbe/lighthouse)
[![CI](https://github.com/mrgambal/lighthouse/workflows/CI/badge.svg)](https://github.com/mrgambal/lighthouse/actions?query=workflow%3ACI)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/a0cb9f75da0a4df887b06d37434cfc04)](https://www.codacy.com/app/mLavaert/lighthouse?utm_source=github.com&utm_medium=referral&utm_content=datamindedbe/lighthouse&utm_campaign=Badge_Grade)

Lighthouse is a library for data lakes built on top of [Apache Spark](http://spark.apache.org/).
Expand Down
9 changes: 4 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import sbt.Opts.resolver.sonatypeStaging
lazy val buildSettings = Seq(
organization := "be.dataminded",
scalaVersion := scala211,
crossScalaVersions := Nil,
crossScalaVersions := supportedScalaVersions,
// Ensure code quality
scalafmtOnCompile := true,
// Memory settings to be able to test with Spark
Expand All @@ -15,14 +15,14 @@ lazy val buildSettings = Seq(
javaOptions ++= Seq(
"-Xms768M",
"-Xmx2048M",
"-XX:+CMSClassUnloadingEnabled",
"-XX:+UseStringDeduplication",
"-XX:+UseG1GC",
"-Dspark.sql.shuffle.partitions=2",
"-Dspark.shuffle.sort.bypassMergeThreshold=2",
"-Dlighthouse.environment=test"
),
scalacOptions ++= Seq(
"-deprecation",
"-optimize",
"-unchecked",
"-Ydelambdafy:inline",
"-Ypartial-unification",
Expand Down Expand Up @@ -61,8 +61,7 @@ lazy val lighthouse = (project in file("lighthouse-core"))
lazy val `lighthouse-testing` = (project in file("lighthouse-testing"))
.settings(
buildSettings,
libraryDependencies ++= Seq(sparkSql, sparkHive, scalaTest, betterFiles),
crossScalaVersions := supportedScalaVersions
libraryDependencies ++= Seq(sparkSql, sparkHive, scalaTest, betterFiles)
)

lazy val `lighthouse-demo` = (project in file("lighthouse-demo"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class LighthouseConfigurationParser extends OptionParser[LighthouseConfiguration

opt[String]('e', "environment")
.action((environment, config) => config.copy(environment = environment))
.withFallback(fallbackEnvironment)
.withFallback(() => fallbackEnvironment())
.validate(item => if (item.nonEmpty) success else failure("The configured environment for Lighthouse is empty"))
.required()

Expand Down
4 changes: 2 additions & 2 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import sbt._

object Dependencies {

private val amazonSdkVersion = "1.11.659"
private val sparkVersion = "2.4.4"
private val amazonSdkVersion = "1.11.682"
private val sparkVersion = "2.4.5"

val sparkCore = "org.apache.spark" %% "spark-core" % sparkVersion % Provided
val sparkSql = "org.apache.spark" %% "spark-sql" % sparkVersion % Provided
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.3.7
sbt.version=1.3.8
3 changes: 2 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0")
addSbtPlugin("com.frugalmechanic" % "fm-sbt-s3-resolver" % "0.19.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.1")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.4.0")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.5.0")

// Publish to Maven Central
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.8.1")
Expand Down