File tree Expand file tree Collapse file tree 3 files changed +53
-2
lines changed Expand file tree Collapse file tree 3 files changed +53
-2
lines changed Original file line number Diff line number Diff line change 11name : test
22on :
3+ schedule :
4+ - cron : ' 0 0 * * *'
35 push :
46 branches :
57 - main
68 pull_request :
79jobs :
8- test :
10+ test : &test
911 strategy :
1012 fail-fast : false
1113 matrix :
1214 java : [8, 11, 17]
1315 scala : [2.13.6, 3.0.2]
1416 runs-on : ubuntu-latest
17+ if : ${{ github.event_name != schedule }}
1518 steps :
1619 - uses : actions/checkout@v2
1720 with :
2225 distribution : temurin
2326 java-version : ${{matrix.java}}
2427 - 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"))
6666 }),
6767 publish / skip := true ,
6868 )
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