forked from winitzki/sofp-solutions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
github-scala-build-and-test.dhall
60 lines (57 loc) · 1.91 KB
/
github-scala-build-and-test.dhall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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.13", "3.3.3", "3.4.0", ] }
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 = "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 = "bash run_sbt.sh -DJDK_VERSION=\${{ matrix.java}} \"++\${{ matrix.scala}} test\"" }
]
}
}
}