Skip to content

Commit 6eb2257

Browse files
committed
initial commit
1 parent f80bdc8 commit 6eb2257

File tree

27 files changed

+885
-1
lines changed

27 files changed

+885
-1
lines changed

.github/workflows/build.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
name: Build
7+
8+
on:
9+
workflow_dispatch:
10+
push:
11+
branches:
12+
- '!main'
13+
# - '*' # matches every branch that doesn't contain a '/'
14+
# - '*/*' # matches every branch containing a single '/'
15+
# - '**' # matches every branch
16+
# - '!main' # excludes main
17+
pull_request:
18+
branches:
19+
- '**'
20+
21+
permissions:
22+
contents: read
23+
24+
jobs:
25+
test:
26+
runs-on: self-hosted
27+
# runs-on: ubuntu-latest
28+
env:
29+
# define Java options for both official sbt and sbt-extras
30+
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
31+
JVM_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v3
35+
- name: Set up JDK 8
36+
uses: actions/setup-java@v3
37+
with:
38+
java-version: '8'
39+
distribution: 'temurin'
40+
# cache: 'sbt'
41+
- name: Run tests
42+
run: sbt test
43+
44+
lint:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Checkout
48+
uses: actions/checkout@v3
49+
- name: Set up JDK 8
50+
uses: actions/setup-java@v3
51+
with:
52+
java-version: '8'
53+
distribution: 'temurin'
54+
# cache: 'sbt'
55+
- name: Formatting
56+
run: sbt scalafmtSbtCheck scalafmtCheck test:scalafmtCheck

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
name: Release
7+
# Run workflow on commits to the `main` branch
8+
on:
9+
workflow_dispatch:
10+
push:
11+
branches:
12+
- 'main'
13+
# - '*' # matches every branch that doesn't contain a '/'
14+
# - '*/*' # matches every branch containing a single '/'
15+
# - '**' # matches every branch
16+
# - '!main' # excludes main
17+
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
release:
23+
runs-on: self-hosted
24+
# runs-on: ubuntu-latest
25+
env:
26+
# define Java options for both official sbt and sbt-extras
27+
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
28+
JVM_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v3
32+
- name: Set up JDK 8
33+
uses: actions/setup-java@v3
34+
with:
35+
java-version: '8'
36+
distribution: 'temurin'
37+
# cache: 'sbt'
38+
- name: Run tests & publish
39+
run: sbt test publish

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
*.class
22
*.log
3+
.idea
4+
*.iml
5+
sbt.json
6+
target
7+
.metals

.scalafmt.conf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version=3.0.2
2+
style = defaultWithAlign
3+
align.openParenCallSite = false
4+
align.openParenDefnSite = false
5+
align.tokens = [{code = "->"}, {code = "<-"}, {code = "=>", owner = "Case"}]
6+
continuationIndent.callSite = 2
7+
continuationIndent.defnSite = 2
8+
danglingParentheses = true
9+
indentOperator = spray
10+
maxColumn = 100
11+
indentOperator.preset = "spray"
12+
danglingParentheses.preset = true
13+
project.excludeFilters = [".*\\.sbt"]
14+
rewrite.rules = [RedundantParens, SortImports]
15+
spaces.inImportCurlyBraces = false
16+
unindentTopLevelOperators = true
17+
project.git = true

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1-
# generic-sequence-api
1+
<!---
2+
This file is auto-generate by a github hook please modify r.md if you don't want to loose your work
3+
-->
4+
![Build Status](https://github.com///github.com/SOFTNETWORK-APP/generic-sequence-api/workflows/Build/badge.svg)
5+
[![codecov](https://codecov.io/gh///github.com/SOFTNETWORK-APP/generic-sequence-api/branch/main/graph/badge.svg)](https://codecov.io/gh///github.com/SOFTNETWORK-APP/generic-sequence-api/)
6+
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/122252a6bdfb41c3af16d31f8cefaecc)](https://www.codacy.com/gh/SOFTNETWORK-APP/generic-sequence-api/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=SOFTNETWORK-APP/generic-sequence-api&amp;utm_campaign=Badge_Grade)
7+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8+
9+
# generic-sequence-api

build.sbt

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import sbt.Resolver
2+
3+
import Common._
4+
import app.softnetwork.sbt.build._
5+
6+
/////////////////////////////////
7+
// Defaults
8+
/////////////////////////////////
9+
10+
app.softnetwork.sbt.build.Publication.settings
11+
12+
/////////////////////////////////
13+
// Useful aliases
14+
/////////////////////////////////
15+
16+
addCommandAlias("cd", "project") // navigate the projects
17+
18+
addCommandAlias("cc", ";clean;compile") // clean and compile
19+
20+
addCommandAlias("pl", ";clean;publishLocal") // clean and publish locally
21+
22+
addCommandAlias("pr", ";clean;publish") // clean and publish globally
23+
24+
addCommandAlias("pld", ";clean;local:publishLocal;dockerComposeUp") // clean and publish/launch the docker environment
25+
26+
addCommandAlias("dct", ";dockerComposeTest") // navigate the projects
27+
28+
ThisBuild / shellPrompt := prompt
29+
30+
ThisBuild / organization := "app.softnetwork"
31+
32+
name := "generic-sequence-api"
33+
34+
ThisBuild / version := "0.1.0"
35+
36+
ThisBuild / scalaVersion := "2.12.15"
37+
38+
ThisBuild / scalacOptions ++= Seq("-deprecation", "-feature", "-target:jvm-1.8")
39+
40+
ThisBuild / javacOptions ++= Seq("-source", "1.8", "-target", "1.8", "-Xlint")
41+
42+
ThisBuild / resolvers ++= Seq(
43+
"Softnetwork Server" at "https://softnetwork.jfrog.io/artifactory/releases/",
44+
"Maven Central Server" at "https://repo1.maven.org/maven2",
45+
"Typesafe Server" at "https://repo.typesafe.com/typesafe/releases"
46+
)
47+
48+
ThisBuild / versionScheme := Some("early-semver")
49+
50+
val scalatest = Seq(
51+
"org.scalatest" %% "scalatest" % Versions.scalatest % Test
52+
)
53+
54+
ThisBuild / libraryDependencies ++= Seq(
55+
"com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf",
56+
"org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.1",
57+
"app.softnetwork.api" %% "generic-server-api" % Versions.server,
58+
"app.softnetwork.api" %% "generic-server-api-testkit" % Versions.server % Test,
59+
"app.softnetwork.protobuf" %% "scalapb-extensions" % "0.1.5"
60+
) ++ scalatest
61+
62+
Compile / unmanagedResourceDirectories += baseDirectory.value / "src/main/protobuf"
63+
64+
Test / parallelExecution := false
65+
66+
lazy val root = project.in(file("."))
67+
.configs(IntegrationTest)
68+
.settings(Defaults.itSettings, BuildInfoSettings.settings)
69+
.enablePlugins(AkkaGrpcPlugin, BuildInfoPlugin)

project/Common.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import app.softnetwork.sbt.build._
2+
3+
object Common extends ConsoleUtils with GitSupport

project/build.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sbt.version=1.7.1

project/plugins.sbt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
logLevel := Level.Warn
2+
3+
resolvers += "Typesafe repository" at "https://repo.typesafe.com/typesafe/releases/"
4+
5+
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.2")
6+
7+
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.3.10")
8+
9+
addSbtPlugin("com.tapad" % "sbt-docker-compose" % "1.0.34")
10+
11+
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0")
12+
13+
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.10.0-RC1")
14+
15+
//addSbtPlugin("com.typesafe.sbt" % "sbt-multi-jvm" % "0.4.0")
16+
17+
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
18+
19+
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.9.3")

project/protoc.sbt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
addSbtPlugin("com.lightbend.akka.grpc" % "sbt-akka-grpc" % "2.1.6")
2+
3+
libraryDependencies += "org.vafer" % "jdeb" % "1.10" artifacts (Artifact("jdeb", "jar", "jar"))

0 commit comments

Comments
 (0)