Skip to content

Commit

Permalink
Update Scala, dependencies and sbt plugins (zio#8760)
Browse files Browse the repository at this point in the history
* Update Scala, dependencies and sbt plugins

* Remove warnings

* Rollback scala-native to v.0.4.x

Because of scalatest/scalatest#2318

* Fix compilation errors

* Fix compilation errors

* scalacheck 1.18.0 is only build for scala-native v.0.5.x

* Clean ci.yml

* Improve `testJvms` CI step to test on 11, 17 and 21

* Remove compilation errors

* Remove compilation errors

* Simplify scala versions declarations

* Unify CI declarations

* Fix import

* Remove compilation errors

* Remove custom sbt script

* Update actions/setup-java

* Update actions/checkout

* Fix CI

* Remove compilation errors

* Try fix CI error:

```
[warn] In the last 10 seconds, 5.18 (52.6%) were spent in GC. [Heap: 0.00GB free of 1.00GB, max 1.00GB] Consider increasing the JVM heap using `-Xmx` or try a different collector, e.g. `-XX:+UseG1GC`, for better performance.
[warn] In the last 10 seconds, 6.369 (67.4%) were spent in GC. [Heap: 0.00GB free of 1.00GB, max 1.00GB] Consider increasing the JVM heap using `-Xmx` or try a different collector, e.g. `-XX:+UseG1GC`, for better performance.

              total        used        free      shared     buffers       cache   available
Mem:          16768        2589       11296          35         230        2652       13780
Swap:          7516           0        7516
Total:        24284        2589       18812
[error] ## Exception when compiling 16 sources to /home/runner/work/zio/zio/scalafix/input/target/scala-2.13/classes
```

* scalafmt

* Fix CI

* Fix CI

* `Compile / fork := false` is declared twice in the `doc` module

* Debug sbt command

* Put back `JVM_OPTS` envvar

* Rollback `Compile / fork` change

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* Use .jvmopts-ci

* Prefer `SBT_OPTS`

* Debug $SBT_OPTS

* Rollback: Debug $SBT_OPTS

* clean

* Add more debug for future maintainers

* clean

* Remove Java 17 from `testJvms` CI step. It's already tested in other jobs

* Fix compilation

* Fix `build-website` CI step
  • Loading branch information
guizmaii authored Apr 20, 2024
1 parent 52b15e2 commit a418fef
Show file tree
Hide file tree
Showing 21 changed files with 152 additions and 826 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v3.5.0
uses: actions/checkout@v4.1.1
with:
fetch-depth: '0'
- name: Approve PR
Expand Down
89 changes: 45 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: CI

env:
JDK_JAVA_OPTIONS: -XX:+PrintCommandLineFlags -Xmx6G -Xss4M -XX:+UseG1GC # JDK_JAVA_OPTIONS is _the_ env. variable to use for modern Java
JVM_OPTS: -XX:+PrintCommandLineFlags -Xmx6G -Xss4M -XX:+UseG1GC # for Java 8 only (sadly, it is not modern enough for JDK_JAVA_OPTIONS)
JDK_JAVA_OPTIONS: -XX:+PrintCommandLineFlags -Xms6G -Xmx6G -Xss4M -XX:+UseG1GC # JDK_JAVA_OPTIONS is _the_ env. variable to use for modern Java
SBT_OPTS: -XX:+PrintCommandLineFlags -Xms6G -Xmx6G -Xss4M -XX:+UseG1GC # Needed for sbt
NODE_OPTIONS: --max_old_space_size=6144

on:
Expand All @@ -23,9 +23,9 @@ jobs:
if: ${{ ((github.event_name != 'repository_dispatch') && (github.event.action != 'update-docs')) }}
steps:
- name: Checkout current branch
uses: actions/checkout@v3.0.2
uses: actions/checkout@v4.1.1
- name: Setup Java
uses: actions/setup-java@v2.5.0
uses: actions/setup-java@v4.2.1
with:
distribution: temurin
java-version: 17
Expand All @@ -35,7 +35,7 @@ jobs:
- name: Install libuv
run: sudo apt-get update && sudo apt-get install -y libuv1-dev
- name: Lint code
run: ./sbt check
run: sbt check

compile:
runs-on: ubuntu-20.04
Expand All @@ -44,12 +44,12 @@ jobs:
strategy:
fail-fast: false
matrix:
scala: ['2.12.*', '2.13.*', '3.*']
scala: ['2.12.x', '2.13.x', '3.x']
steps:
- name: Checkout current branch
uses: actions/checkout@v3.0.2
uses: actions/checkout@v4.1.1
- name: Setup Java
uses: actions/setup-java@v2.5.0
uses: actions/setup-java@v4.2.1
with:
distribution: temurin
java-version: 17
Expand All @@ -64,13 +64,13 @@ jobs:
swap-size-gb: 7
- name: Test/compile 2.12
if: ${{ startsWith(matrix.scala, '2.12.') }}
run: free --si -tmws 10 & ./sbt ++${{ matrix.scala }} root212/Test/compile
run: free --si -tmws 10 & sbt -v ++${{ matrix.scala }} root212/Test/compile
- name: Test/compile 2.13
if: ${{ startsWith(matrix.scala, '2.13.') }}
run: free --si -tmws 10 & ./sbt ++${{ matrix.scala }} root213/Test/compile
run: free --si -tmws 10 & sbt -v ++${{ matrix.scala }} root213/Test/compile
- name: Test/compile 3
if: ${{ startsWith(matrix.scala, '3.') }}
run: free --si -tmws 10 & ./sbt ++${{ matrix.scala }} root3/Test/compile
run: free --si -tmws 10 & sbt -v ++${{ matrix.scala }} root3/Test/compile

publishLocal:
runs-on: ubuntu-20.04
Expand All @@ -79,44 +79,45 @@ jobs:
strategy:
fail-fast: false
matrix:
scala: ['2.12.*', '2.13.*', '3.*']
scala: ['2.12.x', '2.13.x', '3.x']
steps:
- name: Checkout current branch
uses: actions/checkout@v3.0.2
uses: actions/checkout@v4.1.1
- name: Setup Java
uses: actions/setup-java@v2.5.0
uses: actions/setup-java@v4.2.1
with:
distribution: temurin
java-version: 8
java-version: 17
check-latest: true
- name: Cache scala dependencies
uses: coursier/cache-action@v6
- name: Install libuv
run: sudo apt-get update && sudo apt-get install -y libuv1-dev
- name: publishLocal 2.12
if: ${{ startsWith(matrix.scala, '2.12.') }}
run: ./sbt ++${{ matrix.scala }} root212/publishLocal
run: sbt -v ++${{ matrix.scala }} root212/publishLocal
- name: publishLocal 2.13
if: ${{ startsWith(matrix.scala, '2.13.') }}
run: ./sbt ++${{ matrix.scala }} root213/publishLocal
run: sbt -v ++${{ matrix.scala }} root213/publishLocal
- name: publishLocal 3
if: ${{ startsWith(matrix.scala, '3.') }}
run: ./sbt ++${{ matrix.scala }} root3/publishLocal
run: sbt -v ++${{ matrix.scala }} root3/publishLocal

build-website:
runs-on: ubuntu-20.04
if: ${{ ((github.event_name != 'repository_dispatch') && (github.event.action != 'update-docs')) }}
steps:
- name: Checkout Current Branch
uses: actions/checkout@v3
uses: actions/checkout@v4.1.1
with:
fetch-depth: '0'

- name: Setup Scala and Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4.2.1
with:
distribution: 'temurin'
java-version: '17'
distribution: temurin
java-version: 17
check-latest: true

- name: Install NodeJS
uses: actions/setup-node@v3
Expand All @@ -126,8 +127,8 @@ jobs:
- name: Compile Docs
run: |
while true; do free -h; sleep 5; done &
sbt -mem 2048 docs/mdoc -verbose
sbt -mem 2048 docs/unidoc -verbose
sbt -mem 4096 docs/mdoc -verbose
sbt -mem 4096 docs/unidoc -verbose
- name: Build The Website
working-directory: ./website
Expand All @@ -152,14 +153,14 @@ jobs:
strategy:
fail-fast: false
matrix:
scala: ['2.12.18', '2.13.12', '3.3.1']
scala: ['2.12.x', '2.13.x', '3.x']
java: ['17']
platform: ['JVM']
steps:
- name: Checkout current branch
uses: actions/checkout@v3.0.2
uses: actions/checkout@v4.1.1
- name: Setup Java
uses: actions/setup-java@v2.5.0
uses: actions/setup-java@v4.2.1
with:
distribution: temurin
java-version: ${{ matrix.java }}
Expand All @@ -168,16 +169,16 @@ jobs:
uses: coursier/cache-action@v6
- name: Mima Checks
if: ${{ !startsWith(matrix.scala, '3.') }}
run: ./sbt ++${{ matrix.scala }}! mimaChecks
run: sbt -v ++${{ matrix.scala }} mimaChecks
- name: Test 2.12
if: ${{ startsWith(matrix.scala, '2.12.') }}
run: ./sbt ++${{ matrix.scala }}! test${{ matrix.platform }}
run: sbt -v ++${{ matrix.scala }} test${{ matrix.platform }}
- name: Test 2.13
if: ${{ startsWith(matrix.scala, '2.13.') }}
run: ./sbt ++${{ matrix.scala }}! test${{ matrix.platform }}
run: sbt -v ++${{ matrix.scala }} test${{ matrix.platform }}
- name: Test 3
if: ${{ startsWith(matrix.scala, '3.') }}
run: ./sbt ++${{ matrix.scala }}! test${{ matrix.platform }}3
run: sbt -v ++${{ matrix.scala }} test${{ matrix.platform }}3
- name: Upload Test Results 2.12
if: ${{ startsWith(matrix.scala, '2.12.') }}
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -216,21 +217,21 @@ jobs:
strategy:
fail-fast: false
matrix:
java: ['11']
java: ['11', '21']
platform: ['JVM']
steps:
- name: Checkout current branch
uses: actions/checkout@v3.0.2
uses: actions/checkout@v4.1.1
- name: Setup Java
uses: actions/setup-java@v2.5.0
uses: actions/setup-java@v4.2.1
with:
distribution: temurin
java-version: ${{ matrix.java }}
check-latest: true
- name: Cache scala dependencies
uses: coursier/cache-action@v6
- name: Test on different JVM versions
run: ./sbt test${{ matrix.platform }}
run: sbt -v test${{ matrix.platform }}

- name: Report Test Death JVM 11
if: ${{ failure() && startsWith(matrix.java, '11') }}
Expand All @@ -250,9 +251,9 @@ jobs:
platform: ['JS', 'Native']
steps:
- name: Checkout current branch
uses: actions/checkout@v3.0.2
uses: actions/checkout@v4.1.1
- name: Setup Java
uses: actions/setup-java@v2.5.0
uses: actions/setup-java@v4.2.1
with:
distribution: temurin
java-version: ${{ matrix.java }}
Expand All @@ -266,7 +267,7 @@ jobs:
with:
swap-size-gb: 9
- name: Test on different Scala target platforms
run: free --si -tmws 10 & ./sbt test${{ matrix.platform }}
run: free --si -tmws 10 & sbt -v test${{ matrix.platform }}

ci:
runs-on: ubuntu-20.04
Expand All @@ -282,19 +283,19 @@ jobs:
if: github.event_name != 'pull_request'
steps:
- name: Checkout current branch
uses: actions/checkout@v3.0.2
uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v2.5.0
uses: actions/setup-java@v4.2.1
with:
distribution: temurin
java-version: 8
java-version: 17
check-latest: true
- name: Install libuv
run: sudo apt-get update && sudo apt-get install -y libuv1-dev
- name: Release
run: ./sbt ci-release
run: sbt -v ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
Expand All @@ -307,7 +308,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4.1.1
with:
fetch-depth: 0

Expand All @@ -327,7 +328,7 @@ jobs:
if: ${{ ((github.event_name == 'repository_dispatch') && (github.event.action == 'update-docs')) }}
steps:
- name: Git Checkout
uses: actions/checkout@v3.3.0
uses: actions/checkout@v4.1.1
with:
ref: ${{ github.head_ref }}
fetch-depth: '0'
Expand Down
31 changes: 15 additions & 16 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ lazy val root3 = project
)): _*
)

val catsEffectVersion = "3.5.1"
val fs2Version = "3.9.2"
val catsEffectVersion = "3.5.4"
val fs2Version = "3.10.2"

lazy val root = project
.in(file("."))
Expand Down Expand Up @@ -220,7 +220,7 @@ lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform)
libraryDependencies ++= List(
"org.scala-js" %%% "scala-js-macrotask-executor" % "1.1.1",
("org.scala-js" %%% "scalajs-weakreferences" % "1.0.0").cross(CrossVersion.for3Use2_13),
"org.scala-js" %%% "scalajs-dom" % "2.7.0"
"org.scala-js" %%% "scalajs-dom" % "2.8.0"
),
scalacOptions ++= {
if (scalaVersion.value == Scala3) {
Expand Down Expand Up @@ -485,7 +485,7 @@ lazy val testRefined = crossProject(JVMPlatform, JSPlatform)
.settings(
libraryDependencies ++=
Seq(
("eu.timepit" %% "refined" % "0.11.0").cross(CrossVersion.for3Use2_13)
("eu.timepit" %% "refined" % "0.11.1").cross(CrossVersion.for3Use2_13)
)
)
.jsSettings(jsSettings)
Expand All @@ -497,7 +497,7 @@ lazy val testScalaCheck = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.settings(crossProjectSettings)
.settings(
libraryDependencies ++= Seq(
("org.scalacheck" %%% "scalacheck" % "1.17.0")
("org.scalacheck" %%% "scalacheck" % "1.17.1")
)
)
.jsSettings(jsSettings)
Expand Down Expand Up @@ -639,21 +639,21 @@ lazy val benchmarks = project.module
Seq(
"co.fs2" %% "fs2-core" % fs2Version,
"com.google.code.findbugs" % "jsr305" % "3.0.2",
"com.twitter" %% "util-core" % "22.12.0",
"com.typesafe.akka" %% "akka-stream" % "2.8.4",
"com.twitter" %% "util-core" % "23.11.0",
"com.typesafe.akka" %% "akka-stream" % "2.8.5",
"io.github.timwspence" %% "cats-stm" % "0.13.4",
"io.projectreactor" % "reactor-core" % "3.5.10",
"io.projectreactor" % "reactor-core" % "3.6.5",
"io.reactivex.rxjava2" % "rxjava" % "2.2.21",
"org.jctools" % "jctools-core" % "4.0.1",
"org.ow2.asm" % "asm" % "9.5",
"org.jctools" % "jctools-core" % "4.0.3",
"org.ow2.asm" % "asm" % "9.7",
"org.scala-lang" % "scala-compiler" % scalaVersion.value % Provided,
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"org.typelevel" %% "cats-effect" % catsEffectVersion,
"org.typelevel" %% "cats-effect-std" % catsEffectVersion,
"org.scalacheck" %% "scalacheck" % "1.17.0",
"org.scalacheck" %% "scalacheck" % "1.17.1",
"qa.hedgehog" %% "hedgehog-core" % "0.10.1",
"com.github.japgolly.nyaya" %% "nyaya-gen" % "0.10.0",
"org.springframework" % "spring-core" % "6.0.12"
"org.springframework" % "spring-core" % "6.0.19"
),
unusedCompileDependenciesFilter -= libraryDependencies.value
.map(moduleid =>
Expand All @@ -673,12 +673,12 @@ lazy val benchmarks = project.module
.settings(scalacOptions += "-Wconf:msg=[@nowarn annotation does not suppress any warnings]:silent")

lazy val jsdocs = project
.settings(libraryDependencies += ("org.scala-js" %%% "scalajs-dom" % "2.7.0").cross(CrossVersion.for3Use2_13))
.settings(libraryDependencies += ("org.scala-js" %%% "scalajs-dom" % "2.8.0").cross(CrossVersion.for3Use2_13))
.enablePlugins(ScalaJSPlugin)

val http4sV = "0.23.23"
val doobieV = "1.0.0-RC2"
val catsEffectV = "3.5.1"
val catsEffectV = "3.5.4"
val zioActorsV = "0.1.0"

lazy val scalafixSettings = List(
Expand Down Expand Up @@ -724,7 +724,7 @@ lazy val scalafixTests = project
.settings(
scalafixSettings,
publish / skip := true,
libraryDependencies += "ch.epfl.scala" % "scalafix-testkit" % "0.10.1" % Test cross CrossVersion.full,
libraryDependencies += "ch.epfl.scala" % "scalafix-testkit" % "0.12.0" % Test cross CrossVersion.full,
Compile / compile :=
(Compile / compile).dependsOn(scalafixInput / Compile / compile).value,
scalafixTestkitOutputSourceDirectories :=
Expand All @@ -751,7 +751,6 @@ lazy val docs = project.module
scalacOptions -= "-Yno-imports",
scalacOptions -= "-Xfatal-warnings",
scalacOptions += "-Wconf:any:s",
Compile / fork := false,
scalacOptions ~= { _ filterNot (_ startsWith "-Ywarn") },
scalacOptions ~= { _ filterNot (_ startsWith "-Xlint") },
crossScalaVersions --= List(Scala212, Scala3),
Expand Down
6 changes: 3 additions & 3 deletions core-tests/shared/src/test/scala/zio/ExecutorSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ final class CheckPrintThrowable extends Throwable {
}

object TestExecutor {
val failing = new TestExecutor(false)
val y = new TestExecutor(true)
val u = new TestExecutor(true)
val failing = new TestExecutor(submitResult = false)
val y = new TestExecutor(submitResult = true)
val u = new TestExecutor(submitResult = true)

val badEC: ExecutionContext = new ExecutionContext {
override def execute(r: Runnable): Unit = throw new RejectedExecutionException("Rejected: " + r.toString)
Expand Down
Loading

0 comments on commit a418fef

Please sign in to comment.