From d8d80c4d76d7447c3205b526c1f04353a80210d7 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Thu, 19 Nov 2020 15:36:17 +0100 Subject: [PATCH 1/5] Upgrade to Scala 2.13.4, switch CI to JDK 15 2.13.4 brings JDK 15 support with https://github.com/scala/scala/pull/9292 - tests/run/t8153.scala was removed like it was removed in Scala 2 with https://github.com/scala/scala/commit/8f6e522778f23e5b9a51d0b938ed6d20ea0f0d85 - tests/neg/missing-implicit-2.check was updated because the implicitNotFound message was changed in 2.13.4 - tests/run/t6260-delambdafy.scala had to be changed to behave the same under JDK <= 15 and JDK 15. --- .github/workflows/ci.yaml | 30 +++++++++---------- .../scala-parser-combinators | 2 +- community-build/community-projects/scalatest | 2 +- .../scala/dotty/communitybuild/projects.scala | 2 +- .../src/dotty/tools/dotc/core/NameOps.scala | 14 +++++---- .../dotty/tools/dotc/typer/Applications.scala | 2 +- project/Build.scala | 4 +-- .../sbt-test/scala2-compat/i8847/build.sbt | 2 +- .../sbt-test/scala2-compat/i9916a/build.sbt | 2 +- .../sbt-test/scala2-compat/i9916b/build.sbt | 2 +- tests/neg/missing-implicit-2.check | 6 ++-- tests/run/t6260-delambdafy.check | 2 -- tests/run/t6260-delambdafy.scala | 4 ++- tests/run/t8153.check | 1 - tests/run/t8153.scala | 14 --------- 15 files changed, 38 insertions(+), 51 deletions(-) delete mode 100644 tests/run/t8153.check delete mode 100644 tests/run/t8153.scala diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f3c3d6b7e22c..89501ed6c9d1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,7 +13,7 @@ jobs: test: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache @@ -22,8 +22,8 @@ jobs: startsWith(github.event.ref, 'refs/tags/sbt-dotty-'))" steps: - - name: Set JDK 14 as default - run: echo "/usr/lib/jvm/java-14-openjdk-amd64/bin" >> $GITHUB_PATH + - name: Set JDK 15 as default + run: echo "/usr/lib/jvm/java-15-openjdk-amd64/bin" >> $GITHUB_PATH - name: Checkout cleanup script uses: actions/checkout@v2 @@ -45,7 +45,7 @@ jobs: test_bootstrapped: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache @@ -54,8 +54,8 @@ jobs: startsWith(github.event.ref, 'refs/tags/sbt-dotty-'))" steps: - - name: Set JDK 14 as default - run: echo "/usr/lib/jvm/java-14-openjdk-amd64/bin" >> $GITHUB_PATH + - name: Set JDK 15 as default + run: echo "/usr/lib/jvm/java-15-openjdk-amd64/bin" >> $GITHUB_PATH - name: Checkout cleanup script uses: actions/checkout@v2 @@ -110,7 +110,7 @@ jobs: community_build_a: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache @@ -138,7 +138,7 @@ jobs: community_build_b: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache @@ -166,7 +166,7 @@ jobs: test_sbt: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache @@ -196,7 +196,7 @@ jobs: test_java8: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache @@ -231,7 +231,7 @@ jobs: publish_nightly: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache @@ -265,7 +265,7 @@ jobs: nightly_documentation: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache @@ -306,7 +306,7 @@ jobs: publish_release: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache @@ -388,7 +388,7 @@ jobs: release_documentation: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache @@ -432,7 +432,7 @@ jobs: publish_sbt_release: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache diff --git a/community-build/community-projects/scala-parser-combinators b/community-build/community-projects/scala-parser-combinators index e26d523e93f3..da176a05c462 160000 --- a/community-build/community-projects/scala-parser-combinators +++ b/community-build/community-projects/scala-parser-combinators @@ -1 +1 @@ -Subproject commit e26d523e93f313560aac12bb72ff41ab69abf72b +Subproject commit da176a05c4623c4edb81b1274034ad1e85835dc4 diff --git a/community-build/community-projects/scalatest b/community-build/community-projects/scalatest index 6d2b032ad962..1e978e2b1859 160000 --- a/community-build/community-projects/scalatest +++ b/community-build/community-projects/scalatest @@ -1 +1 @@ -Subproject commit 6d2b032ad9629ac8d0e4fa1b147f00cca4000b33 +Subproject commit 1e978e2b185936a8f12274322f8241a0809ec8a0 diff --git a/community-build/src/scala/dotty/communitybuild/projects.scala b/community-build/src/scala/dotty/communitybuild/projects.scala index db7e4134ea4b..37d81db321e9 100644 --- a/community-build/src/scala/dotty/communitybuild/projects.scala +++ b/community-build/src/scala/dotty/communitybuild/projects.scala @@ -297,7 +297,7 @@ object projects: lazy val scalaParserCombinators = SbtCommunityProject( project = "scala-parser-combinators", - sbtTestCommand = "parserCombinators/test", + sbtTestCommand = "parserCombinatorsJVM/test", ) lazy val dottyCpsAsync = SbtCommunityProject( diff --git a/compiler/src/dotty/tools/dotc/core/NameOps.scala b/compiler/src/dotty/tools/dotc/core/NameOps.scala index 26ccc5c87932..ed6e54ab9deb 100644 --- a/compiler/src/dotty/tools/dotc/core/NameOps.scala +++ b/compiler/src/dotty/tools/dotc/core/NameOps.scala @@ -2,6 +2,7 @@ package dotty.tools.dotc package core import java.security.MessageDigest +import java.nio.CharBuffer import scala.io.Codec import Int.MaxValue import Names._, StdNames._, Contexts._, Symbols._, Flags._, NameKinds._, Types._ @@ -32,17 +33,18 @@ object NameOps { def apply(s: String): String = { val marker = "$$$$" - val MaxNameLength = (CLASSFILE_NAME_CHAR_LIMIT - 6) min + val MaxNameLength = (CLASSFILE_NAME_CHAR_LIMIT - 6).min( 2 * (CLASSFILE_NAME_CHAR_LIMIT - 6 - 2 * marker.length - 32) + ) def toMD5(s: String, edge: Int): String = { - val prefix = s take edge - val suffix = s takeRight edge + val prefix = s.take(edge) + val suffix = s.takeRight(edge) val cs = s.toArray - val bytes = Codec toUTF8 cs - md5 update bytes - val md5chars = (md5.digest() map (b => (b & 0xFF).toHexString)).mkString + val bytes = Codec.toUTF8(CharBuffer.wrap(cs)) + md5.update(bytes) + val md5chars = md5.digest().map(b => (b & 0xFF).toHexString).mkString prefix + marker + md5chars + marker + suffix } diff --git a/compiler/src/dotty/tools/dotc/typer/Applications.scala b/compiler/src/dotty/tools/dotc/typer/Applications.scala index 051451cffd55..3960ac1a37bb 100644 --- a/compiler/src/dotty/tools/dotc/typer/Applications.scala +++ b/compiler/src/dotty/tools/dotc/typer/Applications.scala @@ -724,7 +724,7 @@ trait Applications extends Compatibility { def makeVarArg(n: Int, elemFormal: Type): Unit = { val args = typedArgBuf.takeRight(n).toList - typedArgBuf.trimEnd(n) + typedArgBuf.dropRightInPlace(n) val elemtpt = TypeTree(elemFormal) typedArgBuf += seqToRepeated(SeqLiteral(args, elemtpt)) } diff --git a/project/Build.scala b/project/Build.scala index 3acae687fe9d..d009748419a1 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -72,8 +72,8 @@ object Build { * scala-library. */ def stdlibVersion(implicit mode: Mode): String = mode match { - case NonBootstrapped => "2.13.3" - case Bootstrapped => "2.13.3" + case NonBootstrapped => "2.13.4" + case Bootstrapped => "2.13.4" } val dottyOrganization = "org.scala-lang" diff --git a/sbt-dotty/sbt-test/scala2-compat/i8847/build.sbt b/sbt-dotty/sbt-test/scala2-compat/i8847/build.sbt index 3f24e1d347aa..7b620f9a7694 100644 --- a/sbt-dotty/sbt-test/scala2-compat/i8847/build.sbt +++ b/sbt-dotty/sbt-test/scala2-compat/i8847/build.sbt @@ -1,5 +1,5 @@ val scala3Version = sys.props("plugin.scalaVersion") -val scala2Version = "2.13.3" +val scala2Version = "2.13.4" lazy val `i8847-lib` = (project in file ("lib")) .settings(scalaVersion := scala2Version) diff --git a/sbt-dotty/sbt-test/scala2-compat/i9916a/build.sbt b/sbt-dotty/sbt-test/scala2-compat/i9916a/build.sbt index e9c732d4853a..480bb5e1193b 100644 --- a/sbt-dotty/sbt-test/scala2-compat/i9916a/build.sbt +++ b/sbt-dotty/sbt-test/scala2-compat/i9916a/build.sbt @@ -1,5 +1,5 @@ val scala3Version = sys.props("plugin.scalaVersion") -val scala2Version = "2.13.3" +val scala2Version = "2.13.4" lazy val `i9916a-lib` = (project in file ("lib")) .settings(scalaVersion := scala2Version) diff --git a/sbt-dotty/sbt-test/scala2-compat/i9916b/build.sbt b/sbt-dotty/sbt-test/scala2-compat/i9916b/build.sbt index 51a2d056ddad..1b7022040009 100644 --- a/sbt-dotty/sbt-test/scala2-compat/i9916b/build.sbt +++ b/sbt-dotty/sbt-test/scala2-compat/i9916b/build.sbt @@ -1,5 +1,5 @@ val scala3Version = sys.props("plugin.scalaVersion") -val scala2Version = "2.13.3" +val scala2Version = "2.13.4" lazy val `i9916b-lib` = (project in file ("lib")) .settings(scalaVersion := scala2Version) diff --git a/tests/neg/missing-implicit-2.check b/tests/neg/missing-implicit-2.check index 1cf3c1bcb340..edc200b6dec2 100644 --- a/tests/neg/missing-implicit-2.check +++ b/tests/neg/missing-implicit-2.check @@ -1,12 +1,12 @@ -- Error: tests/neg/missing-implicit-2.scala:4:24 ---------------------------------------------------------------------- 4 |val f = Future[Unit] { } // error | ^ - | Cannot find an implicit ExecutionContext. You might pass + | Cannot find an implicit ExecutionContext. You might add | an (implicit ec: ExecutionContext) parameter to your method. | | The ExecutionContext is used to configure how and on which - | thread pools Futures will run, so the specific ExecutionContext - | that is selected is important. + | thread pools asynchronous tasks (such as Futures) will run, + | so the specific ExecutionContext that is selected is important. | | If your application does not define an ExecutionContext elsewhere, | consider using Scala's global ExecutionContext by defining diff --git a/tests/run/t6260-delambdafy.check b/tests/run/t6260-delambdafy.check index ed107b4c8132..eb7212adc211 100644 --- a/tests/run/t6260-delambdafy.check +++ b/tests/run/t6260-delambdafy.check @@ -1,5 +1,3 @@ f(C@2e) apply -get$Lambda -writeReplace diff --git a/tests/run/t6260-delambdafy.scala b/tests/run/t6260-delambdafy.scala index a4a3cfc8ff02..3aa145d2f1c5 100644 --- a/tests/run/t6260-delambdafy.scala +++ b/tests/run/t6260-delambdafy.scala @@ -1,10 +1,12 @@ +import java.lang.reflect.Modifier + class C[A](private val a: Any) extends AnyVal object Test { val f = (x: C[Any]) => {println(s"f($x)"); x} def main(args: Array[String]): Unit = { f(new C(".")) - val methods = f.getClass.getDeclaredMethods.map(_.getName).sorted + val methods = f.getClass.getDeclaredMethods.filter(m => (m.getModifiers & Modifier.PRIVATE) == 0).map(_.getName).sorted println("") println(methods.mkString("\n")) } diff --git a/tests/run/t8153.check b/tests/run/t8153.check deleted file mode 100644 index 0cfbf08886fc..000000000000 --- a/tests/run/t8153.check +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/tests/run/t8153.scala b/tests/run/t8153.scala deleted file mode 100644 index f3063bdc7bfc..000000000000 --- a/tests/run/t8153.scala +++ /dev/null @@ -1,14 +0,0 @@ -object Test { - def f() = { - val lb = scala.collection.mutable.ListBuffer[Int](1, 2) - val it = lb.iterator - if (it.hasNext) it.next() - val xs = lb.toList - lb += 3 - it.mkString - } - - def main(args: Array[String]): Unit = { - println(f()) - } -} From f4b5017e1a9d8207be0a87b25a13d81470d26dae Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Thu, 19 Nov 2020 16:13:35 +0100 Subject: [PATCH 2/5] Run bootstrapped tests on Java 8 We want to make sure that everything works on Java 8, so we should be running the full set of bootstrapped tests. --- .github/workflows/ci.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 89501ed6c9d1..8ccc687a088e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -193,7 +193,7 @@ jobs: - name: Test run: ./project/scripts/sbt sbt-dotty/scripted - test_java8: + test_bootstrapped_java8: runs-on: [self-hosted, Linux] container: image: lampepfl/dotty:2020-11-19 @@ -226,7 +226,9 @@ jobs: run: cp -vf .github/workflows/repositories /root/.sbt/ ; true - name: Test - run: ./project/scripts/sbt ";compile ;test" + run: | + ./project/scripts/sbt ";scala3-bootstrapped/compile ;scala3-bootstrapped/test;sjsSandbox/run;sjsSandbox/test;sjsJUnitTests/test;sjsCompilerTests/test ;sbt-dotty/scripted scala2-compat/* ;configureIDE ;stdlib-bootstrapped/test:run ;stdlib-bootstrapped-tasty-tests/test" + ./project/scripts/bootstrapCmdTests publish_nightly: runs-on: [self-hosted, Linux] @@ -236,7 +238,7 @@ jobs: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache - needs: [test, test_bootstrapped, community_build_a, community_build_b, test_sbt, test_java8] + needs: [test, test_bootstrapped, community_build_a, community_build_b, test_sbt, test_bootstrapped_java8] if: github.event_name == 'schedule' env: NIGHTLYBUILD: yes @@ -311,7 +313,7 @@ jobs: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache - needs: [test, test_bootstrapped, community_build_a, community_build_b, test_sbt, test_java8] + needs: [test, test_bootstrapped, community_build_a, community_build_b, test_sbt, test_bootstrapped_java8] if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') && !startsWith(github.event.ref, 'refs/tags/sbt-dotty-') From ed844e663fcb8ab861f331b670a2c441bba7b8ff Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Thu, 19 Nov 2020 16:23:43 +0100 Subject: [PATCH 3/5] Ci: Don't run non-bootstrapped tests on PRs They mostly check a subset of things that can be detected with bootstrapped tests, it's still useful to know that everything works without bootstrapping on master so keep those tests on pushed commits and releases. --- .github/workflows/ci.yaml | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8ccc687a088e..2471a5ce01cc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,7 +10,7 @@ env: DOTTY_CI_RUN: true jobs: - test: + test_non_bootstrapped: runs-on: [self-hosted, Linux] container: image: lampepfl/dotty:2020-11-19 @@ -18,9 +18,11 @@ jobs: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache - if: "!(github.event_name == 'push' && - startsWith(github.event.ref, 'refs/tags/sbt-dotty-'))" - + if: "( + github.event_name == 'push' && + !startsWith(github.event.ref, 'refs/tags/sbt-dotty-') + ) || + github.event_name == 'schedule')" steps: - name: Set JDK 15 as default run: echo "/usr/lib/jvm/java-15-openjdk-amd64/bin" >> $GITHUB_PATH @@ -42,7 +44,7 @@ jobs: ./project/scripts/sbt ";compile ;test" ./project/scripts/cmdTests - test_bootstrapped: + test: runs-on: [self-hosted, Linux] container: image: lampepfl/dotty:2020-11-19 @@ -74,23 +76,7 @@ jobs: ./project/scripts/sbt ";scala3-bootstrapped/compile ;scala3-bootstrapped/test;sjsSandbox/run;sjsSandbox/test;sjsJUnitTests/test;sjsCompilerTests/test ;sbt-dotty/scripted scala2-compat/* ;configureIDE ;stdlib-bootstrapped/test:run ;stdlib-bootstrapped-tasty-tests/test" ./project/scripts/bootstrapCmdTests - ## Only run bootstrapped tests for Windows since that's a superset of the - ## non-bootstrapped tests and bootstrapping issues should be caught by - ## the non-bootstrapped Linux runner. - # test-windows: - # runs-on: [self-hosted, Windows] - # if: "!(github.event_name == 'push' && - # startsWith(github.event.ref, 'refs/tags/sbt-dotty-'))" - - # steps: - # - name: Git Checkout - # uses: actions/checkout@v2 - - # - name: Test - # run: sbt ";compile ;test" - # shell: cmd - - test_bootstrapped-windows: + test_windows: runs-on: [self-hosted, Windows] if: "!(github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/sbt-dotty-'))" @@ -193,7 +179,7 @@ jobs: - name: Test run: ./project/scripts/sbt sbt-dotty/scripted - test_bootstrapped_java8: + test_java8: runs-on: [self-hosted, Linux] container: image: lampepfl/dotty:2020-11-19 @@ -238,7 +224,7 @@ jobs: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache - needs: [test, test_bootstrapped, community_build_a, community_build_b, test_sbt, test_bootstrapped_java8] + needs: [test_non_bootstrapped, test, community_build_a, community_build_b, test_sbt, test_java8] if: github.event_name == 'schedule' env: NIGHTLYBUILD: yes @@ -313,7 +299,7 @@ jobs: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache - needs: [test, test_bootstrapped, community_build_a, community_build_b, test_sbt, test_bootstrapped_java8] + needs: [test_non_bootstrapped, test, community_build_a, community_build_b, test_sbt, test_java8] if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') && !startsWith(github.event.ref, 'refs/tags/sbt-dotty-') From 1e415b7a1b5766ae0a16443733683cb3da95fa8f Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Thu, 19 Nov 2020 16:31:36 +0100 Subject: [PATCH 4/5] Add a way to run specific tests on the CI With this commit, the CI will look for some magic strings in the body of the PR message (but not in the title of the PR or in individual commit messages) to decide what tests to run, for example if "[test_non_bootstrapped]" appears anywhere in the PR message, the non-bootstrapped tests will be run on top of the normal tests we run for PRs. It's also possible for example to turn off the windows tests with "[skip test_windows]". --- .github/workflows/ci.yaml | 105 +++++++++++++++++++++++++++----------- 1 file changed, 75 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2471a5ce01cc..29b4f7ea5216 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,11 +18,16 @@ jobs: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache - if: "( - github.event_name == 'push' && - !startsWith(github.event.ref, 'refs/tags/sbt-dotty-') - ) || - github.event_name == 'schedule')" + if: "github.event_name == 'schedule' + || ( + github.event_name == 'push' + && !startsWith(github.event.ref, 'refs/tags/sbt-dotty-') + ) + || ( + github.event_name == 'pull_request' + && !contains(github.event.pull_request.body, '[skip ci]') + && contains(github.event.pull_request.body, '[test_non_bootstrapped]') + )" steps: - name: Set JDK 15 as default run: echo "/usr/lib/jvm/java-15-openjdk-amd64/bin" >> $GITHUB_PATH @@ -52,8 +57,16 @@ jobs: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache - if: "!(github.event_name == 'push' && - startsWith(github.event.ref, 'refs/tags/sbt-dotty-'))" + if: "github.event_name == 'schedule' + || ( + github.event_name == 'push' + && !startsWith(github.event.ref, 'refs/tags/sbt-dotty-') + ) + || ( + github.event_name == 'pull_request' + && !contains(github.event.pull_request.body, '[skip ci]') + && !contains(github.event.pull_request.body, '[skip test]') + )" steps: - name: Set JDK 15 as default @@ -78,8 +91,16 @@ jobs: test_windows: runs-on: [self-hosted, Windows] - if: "!(github.event_name == 'push' && - startsWith(github.event.ref, 'refs/tags/sbt-dotty-'))" + if: "github.event_name == 'schedule' + || ( + github.event_name == 'push' + && !startsWith(github.event.ref, 'refs/tags/sbt-dotty-') + ) + || ( + github.event_name == 'pull_request' + && !contains(github.event.pull_request.body, '[skip ci]') + && !contains(github.event.pull_request.body, '[skip test_windows]') + )" steps: - name: Git Checkout @@ -101,6 +122,13 @@ jobs: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache + if: "github.event_name == 'schedule' + || github.event_name == 'push' + || ( + github.event_name == 'pull_request' + && !contains(github.event.pull_request.body, '[skip ci]') + && !contains(github.event.pull_request.body, '[skip community_build]') + )" steps: - name: Checkout cleanup script @@ -129,6 +157,13 @@ jobs: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache + if: "github.event_name == 'schedule' + || github.event_name == 'push' + || ( + github.event_name == 'pull_request' + && !contains(github.event.pull_request.body, '[skip ci]') + && !contains(github.event.pull_request.body, '[skip community_build]') + )" steps: - name: Checkout cleanup script @@ -157,11 +192,16 @@ jobs: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache - if: ( - github.event_name == 'push' && - startsWith(github.event.ref, 'refs/tags/') - ) || - github.event_name == 'schedule' + if: "github.event_name == 'schedule' + || ( + github.event_name == 'push' + && startsWith(github.event.ref, 'refs/tags/') + ) + || ( + github.event_name == 'pull_request' + && !contains(github.event.pull_request.body, '[skip ci]') + && contains(github.event.pull_request.body, '[test_sbt]') + )" steps: - name: Checkout cleanup script @@ -188,12 +228,17 @@ jobs: - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache - if: "( - github.event_name == 'push' && - startsWith(github.event.ref, 'refs/tags/') && - !startsWith(github.event.ref, 'refs/tags/sbt-dotty-') - ) || - github.event_name == 'schedule'" + if: "github.event_name == 'schedule' + || ( + github.event_name == 'push' + && startsWith(github.event.ref, 'refs/tags/') + && !startsWith(github.event.ref, 'refs/tags/sbt-dotty-') + ) + || ( + github.event_name == 'pull_request' + && !contains(github.event.pull_request.body, '[skip ci]') + && contains(github.event.pull_request.body, '[test_java8]') + )" steps: - name: Set JDK 8 as default @@ -225,7 +270,7 @@ jobs: - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache needs: [test_non_bootstrapped, test, community_build_a, community_build_b, test_sbt, test_java8] - if: github.event_name == 'schedule' + if: "github.event_name == 'schedule'" env: NIGHTLYBUILD: yes PGP_PW: ${{ secrets.PGP_PW }} # PGP passphrase @@ -259,7 +304,7 @@ jobs: - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache needs: [publish_nightly] - if: github.event_name == 'schedule' + if: "github.event_name == 'schedule'" env: NIGHTLYBUILD: yes BOT_TOKEN: ${{ secrets.BOT_TOKEN }} # If you need to change this: @@ -300,9 +345,9 @@ jobs: - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache needs: [test_non_bootstrapped, test, community_build_a, community_build_b, test_sbt, test_java8] - if: github.event_name == 'push' && - startsWith(github.event.ref, 'refs/tags/') && - !startsWith(github.event.ref, 'refs/tags/sbt-dotty-') + if: "github.event_name == 'push' + && startsWith(github.event.ref, 'refs/tags/') + && !startsWith(github.event.ref, 'refs/tags/sbt-dotty-')" env: RELEASEBUILD: yes @@ -382,9 +427,9 @@ jobs: - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache needs: [publish_release] - if: github.event_name == 'push' && - startsWith(github.event.ref, 'refs/tags/') && - !startsWith(github.event.ref, 'refs/tags/sbt-dotty-') + if: "github.event_name == 'push' + && startsWith(github.event.ref, 'refs/tags/') + && !startsWith(github.event.ref, 'refs/tags/sbt-dotty-')" env: RELEASEBUILD: yes @@ -426,8 +471,8 @@ jobs: - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache needs: [community_build_a, community_build_b, test_sbt] - if: github.event_name == 'push' && - startsWith(github.event.ref, 'refs/tags/sbt-dotty-') + if: "github.event_name == 'push' + && startsWith(github.event.ref, 'refs/tags/sbt-dotty-')" env: RELEASEBUILD: yes From 07bb6cf31ce0ddb03fe4ffcad900adece6261ccb Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Sat, 21 Nov 2020 00:38:09 +0100 Subject: [PATCH 5/5] Try to make lazy-impl.scala less flaky I've seen it fail on the Windows CI before. --- tests/run/lazy-impl.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/run/lazy-impl.scala b/tests/run/lazy-impl.scala index 675bf204222b..a941dc89100a 100644 --- a/tests/run/lazy-impl.scala +++ b/tests/run/lazy-impl.scala @@ -201,7 +201,7 @@ object Test { val rand = java.util.Random() val c = new C() val readers = - for i <- 0 until 1000 yield + for i <- 0 until 500 yield new Thread { override def run() = { Thread.sleep(rand.nextInt(50))