-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
sergei.winitzki
committed
Nov 22, 2023
1 parent
1c90593
commit e768cbc
Showing
7 changed files
with
142 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
jobs: | ||
build: | ||
name: Build | ||
needs: | ||
- checks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: "actions/checkout@v2" | ||
with: | ||
submodules: 'true' | ||
- name: "~/.sbt\n\"~/.cache/coursier\"\n cache" | ||
uses: "actions/cache@v3" | ||
with: | ||
key: "${{ runner.os }}-sbt-${{ hashFiles('build.sbt', 'project/plugins.sbt', 'project/build.properties') }}" | ||
path: | | ||
~/.sbt | ||
"~/.cache/coursier" | ||
restore-keys: | | ||
${{ runner.os }}-sbt | ||
- name: "java ${{ matrix.java}} setup" | ||
uses: "actions/[email protected]" | ||
with: | ||
architecture: x64 | ||
java-package: jdk | ||
java-version: "${{ matrix.java}}" | ||
- run: "sbt -DJDK_VERSION=${{ matrix.java}} \"++${{ matrix.scala}} test\"" | ||
strategy: | ||
matrix: | ||
java: | ||
- '8.0.382' | ||
- '11.0.21' | ||
- '17.0.9' | ||
scala: | ||
- '2.13.11' | ||
checks: | ||
name: Check formatting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: "actions/checkout@v2" | ||
with: | ||
submodules: 'true' | ||
- name: "~/.sbt\n\"~/.cache/coursier\"\n cache" | ||
uses: "actions/cache@v3" | ||
with: | ||
key: "${{ runner.os }}-sbt-${{ hashFiles('build.sbt', 'project/plugins.sbt', 'project/build.properties') }}" | ||
path: | | ||
~/.sbt | ||
"~/.cache/coursier" | ||
restore-keys: | | ||
${{ runner.os }}-sbt | ||
- name: java 17 setup | ||
uses: "actions/[email protected]" | ||
with: | ||
architecture: x64 | ||
java-package: jdk | ||
java-version: '17' | ||
- run: sbt scalafmtCheckAll scalafmtSbtCheck | ||
name: scall_build_and_test | ||
on: | ||
push: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# See https://scalameta.org/scalafmt/docs/configuration.html | ||
version=3.7.17 # This is the version of the scalafmt formatter core. | ||
runner.dialect=scala213 # May need to override this for some files. | ||
preset=IntelliJ | ||
maxColumn = 160 | ||
align.preset=most | ||
rewrite.trailingCommas.style = multiple | ||
rewrite.trailingCommas.allowFolding = true | ||
verticalMultiline.arityThreshold = 5 | ||
verticalMultiline.newlineAfterOpenParen = true | ||
rewriteTokens = { | ||
"⇒": "=>" | ||
"→": "->" | ||
"←": "<-" | ||
} | ||
importSelectors = singleLine | ||
optIn.breakChainOnFirstMethodDot = false | ||
optIn.breaksInsideChains = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
# sofp-solutions | ||
|
||
Solutions for exercises in the book "Science of functional programming" | ||
|
||
Solutions for each chapter is a submodule in this project. | ||
|
||
Common code may be put into the `common` submodule. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
let GithubActions = | ||
https://regadas.dev/github-actions-dhall/package.dhall | ||
sha256:71df44892a17abca817cfb35e2612d117f7fceec55114a6eb76b65a7eea4e6f4 | ||
|
||
let matrix = | ||
toMap { java = [ "8.0.382", "11.0.21", "17.0.9" ], scala = [ "2.13.11" ] } | ||
|
||
let setup = | ||
[ GithubActions.steps.actions/checkout // { `with` = Some (toMap { submodules = "true" }) } | ||
, GithubActions.steps.actions/cache | ||
{ path = | ||
'' | ||
~/.sbt | ||
"~/.cache/coursier" | ||
'' | ||
, key = "sbt" | ||
, hashFiles = | ||
[ "build.sbt" | ||
, "project/plugins.sbt" | ||
, "project/build.properties" | ||
] | ||
} | ||
] | ||
|
||
in GithubActions.Workflow::{ | ||
, name = "scall_build_and_test" | ||
, on = GithubActions.On::{ | ||
, push = Some GithubActions.Push::{=} | ||
--, pull_request = Some GithubActions.PullRequest::{=} | ||
} | ||
, jobs = toMap | ||
{ checks = GithubActions.Job::{ | ||
, name = Some "Check formatting" | ||
, runs-on = GithubActions.types.RunsOn.ubuntu-latest | ||
, steps = | ||
setup | ||
# [ GithubActions.steps.actions/setup-java { java-version = "17" } | ||
, GithubActions.steps.run | ||
{ run = "sbt scalafmtCheckAll scalafmtSbtCheck" } | ||
] | ||
} | ||
, build = GithubActions.Job::{ | ||
, name = Some "Build" | ||
, needs = Some [ "checks" ] | ||
, strategy = Some GithubActions.Strategy::{ matrix } | ||
, runs-on = GithubActions.types.RunsOn.ubuntu-latest | ||
, steps = | ||
setup | ||
# [ GithubActions.steps.actions/setup-java | ||
{ java-version = "\${{ matrix.java}}" } | ||
, GithubActions.steps.run | ||
{ run = "sbt -DJDK_VERSION=\${{ matrix.java}} \"++\${{ matrix.scala}} test\"" } | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sbt scalafmtAll scalafmtSbt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dhall-to-yaml --file github-scala-build-and-test.dhall > .github/workflows/build-and-test.yml |