Skip to content

Commit

Permalink
feat(ci)(cd): basic workflows (#1)
Browse files Browse the repository at this point in the history
scalafmt conf and basic CI/CD workflows
  • Loading branch information
datYori authored Oct 1, 2024
1 parent 930dfc0 commit 1ff5ecd
Show file tree
Hide file tree
Showing 3 changed files with 191 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI
on:
pull_request:
paths:
- .github/workflows/ci.yaml
- build.sbt
- .scalafmt.conf
- project/**
- src/**

defaults:
run:
shell: bash

env:
GITHUB_TOKEN: ${{ secrets.READ_PACKAGES }}

jobs:
code-check:
runs-on: self-hosted
container:
image: sbtscala/scala-sbt:eclipse-temurin-jammy-21.0.2_13_1.9.9_2.12.19
options: --user 1001:1001
steps:
- uses: actions/checkout@v4
- run: sbt headerCheckAll
test:
runs-on: self-hosted
container:
image: sbtscala/scala-sbt:eclipse-temurin-jammy-21.0.2_13_1.9.9_2.12.19
options: --user 1001:1001
steps:
- uses: actions/checkout@v4
- run: sbt clean test
21 changes: 21 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: publish
on:
push:
tags:
- "v*.*.*"

env:
GITHUB_TOKEN: ${{ secrets.WRITE_PACKAGES }}

jobs:
publish:
runs-on: self-hosted
container:
image: sbtscala/scala-sbt:eclipse-temurin-jammy-21.0.2_13_1.9.9_2.12.19
options: --user 1001:1001
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: sbt publish
run: sbt clean publish
136 changes: 136 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
version = 2.7.5
maxColumn = 120

optIn.forceBlankLineBeforeDocstring = true
trailingCommas = "never"

align {
openParenCallSite = false
openParenDefnSite = false
preset=some
stripMargin = false
tokens = []
}

assumeStandardLibraryStripMargin = true
binPack.parentConstructors = "never"

continuationIndent {
callSite = 2
ctorSite = 4
defnSite = 4
extendSite = 4
}

danglingParentheses {
ctrlSite = true
defnSite = true
}


docstrings.style = "Asterisk" // JavaDoc
includeCurlyBraceInSelectChains = true
includeNoParensInSelectChains = false

literals {
double = "Lower"
float = "Lower"
hexDigits = "Lower"
hexPrefix = "Lower"
long = "Upper"
}

newlines {
afterCurlyLambdaParams = squash
afterCurlyLambdaParams=squash
alwaysBeforeElseAfterCurlyIf = false
beforeCurlyLambdaParams = multilineWithCaseOnly
beforeMultiline = fold
beforeMultilineDef = false
implicitParamListModifierPrefer = before
}

rewrite {
redundantBraces {
generalExpressions = false
ifElseExpressions = false
methodBodies = false
parensForOneLineApply = true
stringInterpolation = true
}
rules = [
RedundantBraces,
RedundantParens,
SortModifiers,
SortImports
]
redundantBraces {
generalExpressions = false
methodBodies = false
ifElseExpressions = false
parensForOneLineApply = true
stringInterpolation = true
}
sortModifiers {
order = [
"implicit",
"final",
"sealed",
"abstract",
"override",
"private",
"protected",
"lazy"
]
}
}

continuationIndent {
callSite = 2
defnSite = 4
ctorSite = 4
extendSite = 4
}

align {
preset=some
tokens = []
openParenCallSite = false
openParenDefnSite = false
preset = some
stripMargin = false
tokens = []
}

danglingParentheses {
defnSite = true
ctrlSite = true
}

spaces {
afterKeywordBeforeParen = true
afterSymbolicDefs = false
beforeContextBoundColon = "Never"
inByNameTypes = true
inParentheses = false
neverAroundInfixTypes = []
afterKeywordBeforeParen = true
inByNameTypes = true
afterSymbolicDefs = false
}

literals {
long = "Upper"
float = "Lower"
double = "Lower"
hexPrefix = "Lower"
hexDigits = "Lower"
}

docstrings {
style = "Asterisk" // JavaDoc
}

binPack {
parentConstructors = "Never"
}

0 comments on commit 1ff5ecd

Please sign in to comment.