Skip to content

Commit

Permalink
#15: Migrated to Github Actions from Travis (#16)
Browse files Browse the repository at this point in the history
Fixes #4 #15
  • Loading branch information
morazow committed Aug 31, 2021
1 parent 3958fef commit afaa5b6
Show file tree
Hide file tree
Showing 30 changed files with 312 additions and 884 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/broken_links_checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Broken Links Checker

on:
schedule:
- cron: "0 5 * * *"
push:

jobs:
linkChecker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: 'yes'
use-verbose-mode: 'yes'
72 changes: 72 additions & 0 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: CI Build

on:
- push

jobs:
build:
name: Building with Scala ${{ matrix.scala }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
scala: [ 2.12.14, 2.13.6 ]

steps:
- name: Checkout the Repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Java and Scala with JDK 11
uses: olafurpg/setup-scala@v10
with:
java-version: 11

- name: Cache Local SBT Dependencies
uses: actions/cache@v2
with:
path: |
~/.sbt
~/.ivy2/cache
~/.coursier/cache/v1
~/.cache/coursier/v1
key: ${{ runner.os }}-sbt-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
restore-keys: |
${{ runner.os }}-sbt-cache-
- name: Check Formatting
run: sbt ++${{ matrix.scala }} scalafmtSbtCheck scalafmtCheckAll

- name: Run CI
run: ./scripts/ci.sh
env:
SCALA_VERSION: ${{ matrix.scala }}

- name: Upload Coverage Results to Coveralls
run: sbt ++${{ matrix.scala }} coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# This required because of the sonarcloud-github-action docker volume mapping.
- name: Prepare for Sonar Cloud Scan
if: startsWith(matrix.scala, '2.13')
run: |
find . -name scoverage.xml -exec sed -i \
's#/home/runner/work/import-export-udf-common-scala/import-export-udf-common-scala#/github/workspace#g' {} +
- name: Sonar Cloud Scan
if: startsWith(matrix.scala, '2.13')
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

- name: Cleanup
run: |
rm -rf "$HOME/.ivy2/local" || true
find $HOME/Library/Caches/Coursier/v1 -name "ivydata-*.properties" -delete || true
find $HOME/.ivy2/cache -name "ivydata-*.properties" -delete || true
find $HOME/.cache/coursier/v1 -name "ivydata-*.properties" -delete || true
find $HOME/.coursier/cache -name "*.lock" -delete || true
find $HOME/.sbt -name "*.lock" -delete || true
40 changes: 33 additions & 7 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,19 +1,45 @@
version = 3.0.1
project.git = true

maxColumn = 98
docstrings = JavaDoc
maxColumn = 120
docstrings.style = Asterisk
docstrings.wrap = "no"

align = true
align.openParenCallSite = false
align.openParenDefnSite = false
align.stripMargin = true
assumeStandardLibraryStripMargin = true
continuationIndent.defnSite = 2
danglingParentheses = true
danglingParentheses.preset = true

assumeStandardLibraryStripMargin = true
rewrite.redundantBraces.stringInterpolation = true
rewrite.rules = [
AsciiSortImports,
AvoidInfix,
PreferCurlyFors,
RedundantBraces,
RedundantParens,
PreferCurlyFors,
SortImports
SortModifiers
]
rewrite.neverInfix.excludeFilters = [
at
exclude
excludeAll
in
to
until
]
rewrite.redundantBraces.generalExpressions = false
rewrite.redundantBraces.ifElseExpressions = false
rewrite.redundantBraces.stringInterpolation = true
rewrite.sortModifiers.order = [
"`override`"
"`private`"
"`protected`"
"`sealed`"
"`abstract`"
"`lazy`"
"`implicit`"
"`final`"
]
spaces.inImportCurlyBraces = false
50 changes: 0 additions & 50 deletions .travis.yml

This file was deleted.

24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
# Import Export UDF Common Scala

[![Build Status][travis-badge]][travis-link]
[![Coveralls][coveralls-badge]][coveralls-link]
[![Maven Central][maven-badge]][maven-link]
[![Build Status](https://github.com/exasol/import-export-udf-common-scala/actions/workflows/ci-build.yml/badge.svg)](https://github.com/exasol/import-export-udf-common-scala/actions/workflows/ci-build.yml)
[![Coveralls](https://img.shields.io/coveralls/exasol/import-export-udf-common-scala.svg)](https://coveralls.io/github/exasol/import-export-udf-common-scala)
[![Maven Central](https://img.shields.io/maven-central/v/com.exasol/import-export-udf-common-scala)](https://search.maven.org/artifact/com.exasol/import-export-udf-common-scala)

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aimport-export-udf-common-scala&metric=alert_status)](https://sonarcloud.io/dashboard?id=com.exasol%3Aimport-export-udf-common-scala)

[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aimport-export-udf-common-scala&metric=security_rating)](https://sonarcloud.io/dashboard?id=com.exasol%3Aimport-export-udf-common-scala)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aimport-export-udf-common-scala&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=com.exasol%3Aimport-export-udf-common-scala)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aimport-export-udf-common-scala&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=com.exasol%3Aimport-export-udf-common-scala)
[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aimport-export-udf-common-scala&metric=sqale_index)](https://sonarcloud.io/dashboard?id=com.exasol%3Aimport-export-udf-common-scala)

[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aimport-export-udf-common-scala&metric=code_smells)](https://sonarcloud.io/dashboard?id=com.exasol%3Aimport-export-udf-common-scala)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aimport-export-udf-common-scala&metric=coverage)](https://sonarcloud.io/dashboard?id=com.exasol%3Aimport-export-udf-common-scala)
[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aimport-export-udf-common-scala&metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=com.exasol%3Aimport-export-udf-common-scala)
[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aimport-export-udf-common-scala&metric=ncloc)](https://sonarcloud.io/dashboard?id=com.exasol%3Aimport-export-udf-common-scala)

Common libraries for Exasol IMPORT and EXPORT user defined functions in Scala
programming language.
Expand Down Expand Up @@ -60,12 +72,6 @@ These plugins help with project development.
| [SBT PGP][sbt-pgp-link] | PGP plugin for `sbt` | BSD 3-Clause License |
| [SBT Git][sbt-git-link] | A plugin for Git integration, used to version the release jars | BSD 2-Clause License |

[travis-badge]: https://img.shields.io/travis/com/exasol/import-export-udf-common-scala/main.svg?logo=travis
[travis-link]: https://travis-ci.com/exasol/import-export-udf-common-scala
[coveralls-badge]: https://coveralls.io/repos/github/exasol/import-export-udf-common-scala/badge.svg?branch=main
[coveralls-link]: https://coveralls.io/github/exasol/import-export-udf-common-scala?branch=main
[maven-badge]: https://maven-badges.herokuapp.com/maven-central/com.exasol/import-export-udf-common-scala_2.12/badge.svg
[maven-link]: https://mvnrepository.com/artifact/com.exasol/import-export-udf-common-scala
[apache-avro-link]: https://avro.apache.org/
[scala-logging-link]: https://github.com/lightbend/scala-logging
[exasol-script-api-link]: https://docs.exasol.com/database_concepts/udf_scripts.htm
Expand Down
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ lazy val orgSettings = Seq(
)

lazy val buildSettings = Seq(
scalaVersion := "2.13.3",
crossScalaVersions := Seq("2.12.12", "2.13.3")
scalaVersion := "2.13.6",
crossScalaVersions := Seq("2.12.14", "2.13.6")
)

lazy val root =
Expand Down
1 change: 1 addition & 0 deletions doc/changes/changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Releases

* [0.3.0](changes_0.3.0.md)
* [0.2.0](changes_0.2.0.md)
* [0.1.0](changes_0.1.0.md)
35 changes: 35 additions & 0 deletions doc/changes/changes_0.3.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Import Export UDF Common Scala 0.3.0, released 2021-??-??

Code name:

## Summary

## Refactoring

## Dependency Updates

### Runtime Dependency Updates

* Updated `com.fasterxml.jackson.core:jackson-databind:2.11.3` to `2.12.5`
* Updated `com.fasterxml.jackson.module:jackson-module-scala:2.11.3` to `2.12.5`
* Updated `com.typesafe.scala-logging:scala-logging:3.9.2` to `3.9.4`
* Updated `org.apache.avro:avro:1.10.0` to `1.10.2`
* Updated `org.slf4j:slf4j-simple:1.7.30` to `1.7.32`

### Test Dependency Updates

* Updated `org.mockito:mockito-core:test:3.6.0` to `3.12.4`
* Updated `org.scalatest:scalatest:test:3.2.2` to `3.2.9`

### Plugin Updates

* Added `org.scalameta:sbt-scalafmt:2.4.3`
* Updated `com.jsuereth:sbt-pgp:2.0.1` to `2.1.1`
* Updated `com.timushev.sbt:sbt-updates:0.5.1` to `0.6.0`
* Updated `com.typesafe.sbt:sbt-git:1.0.0` to `1.0.1`
* Updated `org.scoverage:sbt-coveralls:1.2.7` to `1.3.1`
* Updated `org.scoverage:sbt-scoverage:1.6.1` to `1.8.2`
* Updated `org.wartremover:sbt-wartremover:2.4.12` to `2.4.16`
* Updated `org.wartremover:sbt-wartremover-contib:1.3.10` to `1.3.12`
* Updated `org.xerial.sbt:sbt-sonatype:3.9.4` to `3.9.10`
* Removed `com.github.cb372:sbt-explicit-dependencies:0.2.15`
20 changes: 10 additions & 10 deletions doc/development/developer_guide.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Developer Guide

This guide provides development workflows that are used to develop and maintain
the import-export-udf-common-scala and the projects based on it. It is intended for those who wish to address
the issues, merge a pull request, perform release or deep dive into the codebase
of the project.
the import-export-udf-common-scala and the projects based on it. It is intended
for those who wish to address the issues, merge a pull request, perform release
or deep dive into the codebase of the project.

## Contributing

Expand All @@ -13,8 +13,8 @@ Please feel free to report a bug, suggest an idea for a feature, or ask a
question about the code.

Please keep in mind that contributions are not only pull requests. They can be
any helpful comment on issues, improving documentation, enhancing the build process
and many other tasks.
any helpful comment on issues, improving documentation, enhancing the build
process and many other tasks.

### Getting in Touch

Expand Down Expand Up @@ -72,15 +72,15 @@ First clone a local copy of the repository:
git clone https://github.com/exasol/import-export-udf-common-scala.git
```

Then run `./sbtx`, and run any of these commands:
Then run `sbt`, and run any of these commands:

- `clean` : cleans previously compiled outputs; to start clean again.
- `compile` : compiles the source files.
- `test:compile`: compiles the unit test files.
- `it:compile` : compiles the integration test files.
- `test` : run all the unit tests.
- `it:test` : run all the integration tests.
- `doc` : generate the api documentation.
- `doc` : generate the API documentation.

You can also run several commands combined together:

Expand All @@ -95,8 +95,8 @@ to only run single file tests.

Inside the `scripts/` folder, you will find the `ci.sh` bash file, that runs
end-to-end build process. This file is intended to be run in continuous
integration (CI) environment. For the continuous integration we use the [Travis
CI](https://travis-ci.com/).
integration (CI) environment. For the continuous integration we use the Github
Actions.

Please run this file to make sure that everything is working before committing
code or submitting a pull request.
Expand All @@ -109,7 +109,7 @@ Additionally, ensure that the `ci.sh` scripts work with different versions of
the Scala programming language. You can check that with the following command:

```bash
TRAVIS_SCALA_VERSION=2.11.12 ./scripts/ci.sh
SCALA_VERSION=2.13.6 ./scripts/ci.sh
```

## Checking the Test Coverage
Expand Down
16 changes: 8 additions & 8 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ object Dependencies {

// Runtime dependencies versions
private val ExasolVersion = "6.1.7"
private val AvroVersion = "1.10.0"
private val JacksonVersion = "2.11.3"
private val TypesafeLoggingVersion = "3.9.2"
private val SLF4JVersion = "1.7.30"
private val AvroVersion = "1.10.2"
private val JacksonVersion = "2.12.5"
private val TypesafeLoggingVersion = "3.9.4"
private val SLF4JSimpleVersion = "1.7.32"

// Test dependencies versions
private val ScalaTestVersion = "3.2.2"
private val ScalaTestVersion = "3.2.9"
private val ScalaTestPlusVersion = "1.0.0-M2"
private val MockitoCoreVersion = "3.6.0"
private val MockitoCoreVersion = "3.12.4"

val ExasolResolvers: Seq[Resolver] = Seq(
"Exasol Releases" at "https://maven.exasol.com/artifactory/exasol-releases"
)

lazy val RuntimeDependencies: Seq[ModuleID] = Seq(
"com.exasol" % "exasol-script-api" % ExasolVersion,
"org.slf4j" % "slf4j-simple" % SLF4JVersion,
"org.slf4j" % "slf4j-simple" % SLF4JSimpleVersion,
"com.typesafe.scala-logging" %% "scala-logging" % TypesafeLoggingVersion
exclude ("org.slf4j", "slf4j-api")
exclude ("org.scala-lang", "scala-library")
Expand All @@ -33,7 +33,7 @@ object Dependencies {
excludeAll (
ExclusionRule(organization = "com.fasterxml.jackson.core"),
ExclusionRule(organization = "com.fasterxml.jackson.module")
),
),
"com.fasterxml.jackson.core" % "jackson-databind" % JacksonVersion,
"com.fasterxml.jackson.module" %% "jackson-module-scala" % JacksonVersion
)
Expand Down
Loading

0 comments on commit afaa5b6

Please sign in to comment.