File tree 3 files changed +53
-2
lines changed
3 files changed +53
-2
lines changed Original file line number Diff line number Diff line change 1
1
name : test
2
2
on :
3
+ schedule :
4
+ - cron : ' 0 0 * * *'
3
5
push :
4
6
branches :
5
7
- main
6
8
pull_request :
7
9
jobs :
8
- test :
10
+ test : &test
9
11
strategy :
10
12
fail-fast : false
11
13
matrix :
12
14
java : [8, 11, 17]
13
15
scala : [2.13.6, 3.0.2]
14
16
runs-on : ubuntu-latest
17
+ if : ${{ github.event_name != schedule }}
15
18
steps :
16
19
- uses : actions/checkout@v2
17
20
with :
22
25
distribution : temurin
23
26
java-version : ${{matrix.java}}
24
27
- name : Test
25
- run : sbt ++${{matrix.scala}} test core/headerCheck package
28
+ run : sbt "setScalaVersion ${{matrix.scala}}" test core/headerCheck package
29
+
30
+ test-rc :
31
+ << : *test
32
+ strategy :
33
+ fail-fast : false
34
+ matrix :
35
+ java : [8]
36
+ scala : [3.next]
37
+ if : ${{ github.event_name == schedule }}
Original file line number Diff line number Diff line change @@ -66,3 +66,11 @@ lazy val testmacros = project.in(file("testmacros"))
66
66
}),
67
67
publish / skip := true ,
68
68
)
69
+
70
+ commands += Command .single(" setScalaVersion" ) { (state, arg0) =>
71
+ val arg = arg0 match {
72
+ case " 3.next" => GetScala3Next .get()
73
+ case _ => arg0
74
+ }
75
+ s " ++ $arg" :: state
76
+ }
Original file line number Diff line number Diff line change
1
+ import java .nio .ByteBuffer
2
+
3
+ import scala .concurrent ._ , duration ._
4
+
5
+ import gigahorse ._ , support .okhttp .Gigahorse
6
+
7
+ import sjsonnew .shaded .scalajson .ast .unsafe ._
8
+ import sjsonnew .support .scalajson .unsafe .{ Converter , Parser }
9
+
10
+ object GetScala3Next {
11
+ val asJson = (r : FullResponse ) => Parser .parseFromByteBuffer(r.bodyAsByteBuffer).get
12
+
13
+ def get (): String = {
14
+ val req = Gigahorse .url(" https://api.github.com/repos/lampepfl/dotty/releases" )
15
+ .get.addQueryString(" per_page" -> " 1" )
16
+
17
+ val http = Gigahorse .http(Gigahorse .config)
18
+
19
+ try {
20
+ val f = http.run(req, asJson)
21
+
22
+ val f2 = f.collect {
23
+ case JArray (Array (JObject (fields))) => fields.collectFirst {
24
+ case JField (" tag_name" , JString (version)) => version
25
+ }
26
+ }.map(_.getOrElse(sys.error(s " Expected an array of 1 string, got $j" )))
27
+
28
+ Await .result(f2, 120 .seconds)
29
+ } finally http.close()
30
+ }
31
+ }
You can’t perform that action at this time.
0 commit comments