Skip to content

Commit

Permalink
Merge branch 'series/2.x' into update/auxlib-0.5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
guizmaii authored Aug 26, 2024
2 parents 8fd36b9 + 06ebe55 commit 336b20e
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 40 deletions.
41 changes: 12 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: CI

env:
JDK_JAVA_OPTIONS: -XX:+PrintCommandLineFlags -XX:MaxMetaspaceSize=4G -Xmx4G -Xss8M # JDK_JAVA_OPTIONS is _the_ env. variable to use for modern Java
JDK_JAVA_OPTIONS: -XX:+PrintCommandLineFlags -Xms6G -Xmx6G # JDK_JAVA_OPTIONS is _the_ env. variable to use for modern Java
SBT_OPTS: -XX:+PrintCommandLineFlags -Xms6G -Xmx6G # Needed for sbt
NODE_OPTIONS: --max_old_space_size=6144

on:
Expand All @@ -22,15 +23,13 @@ jobs:
with:
fetch-depth: 0
- name: Setup Java
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
distribution: temurin
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: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
Expand All @@ -50,15 +49,13 @@ jobs:
- name: Checkout current branch
uses: actions/[email protected]
- name: Setup Java
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
distribution: temurin
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: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
Expand All @@ -73,7 +70,7 @@ jobs:
- name: Checkout current branch
uses: actions/[email protected]
- name: Setup Java
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
distribution: temurin
java-version: 11 # ensure it works on 11 because we publish for 11
Expand All @@ -85,8 +82,6 @@ jobs:
registry-url: https://registry.npmjs.org
- 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: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
Expand All @@ -111,15 +106,13 @@ jobs:
with:
fetch-depth: 0
- name: Setup Java
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
distribution: temurin
java-version: ${{ matrix.java }}
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: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
Expand All @@ -146,15 +139,13 @@ jobs:
- name: Checkout current branch
uses: actions/[email protected]
- name: Setup Java
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
distribution: temurin
java-version: ${{ matrix.java }}
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: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
Expand All @@ -174,21 +165,19 @@ jobs:
- name: Checkout current branch
uses: actions/[email protected]
- name: Setup Java
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
distribution: temurin
java-version: ${{ matrix.java }}
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: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 7
- name: Test on different Scala target platforms
run: ./sbt root${{ matrix.platform }}/test
run: ./sbt test${{ matrix.platform }}

update-readme:
name: Update README
Expand All @@ -200,10 +189,8 @@ jobs:
uses: actions/[email protected]
with:
fetch-depth: '0'
- name: Install libuv
run: sudo apt-get update && sudo apt-get install -y libuv1-dev
- name: Setup Scala
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
distribution: temurin
java-version: '17'
Expand Down Expand Up @@ -272,15 +259,13 @@ jobs:
with:
fetch-depth: 0
- name: Setup Java
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
distribution: temurin
java-version: 11 # publish for 11
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: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
Expand All @@ -305,10 +290,8 @@ jobs:
uses: actions/[email protected]
with:
fetch-depth: '0'
- name: Install libuv
run: sudo apt-get update && sudo apt-get install -y libuv1-dev
- name: Setup Scala
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
distribution: temurin
java-version: '11'
Expand Down
4 changes: 4 additions & 0 deletions .sbtopts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-J-Xmx4G
-J-Xms512M
-J-Xss4M
-J-XX:+UseG1GC
8 changes: 4 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import BuildHelper._
import BuildHelper.*

Global / onChangedBuildSource := ReloadOnSourceChanges
Global / concurrentRestrictions += Tags.limit(NativeTags.Link, 1)
Global / concurrentRestrictions += Tags.limit(NativeTags.Link, java.lang.Runtime.getRuntime.availableProcessors())

inThisBuild(
List(
Expand Down Expand Up @@ -35,10 +35,10 @@ addCommandAlias(
)
addCommandAlias(
"testNative",
";coreTestsNative/test;experimentalTestsNative/test" // `test` currently executes only compilation, see `nativeSettings` in `BuildHelper`
";coreTestsNative/test;experimentalTestsNative/test"
)

val zioVersion = "2.1.7"
val zioVersion = "2.1.8"

val projectsCommon = List(
core,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package zio.prelude

import zio._
import zio.test.TestAspect._
import zio.test._

trait ZIOBaseSpec extends ZIOSpecDefault {
override def aspects: Chunk[TestAspectAtLeastR[Environment with TestEnvironment]] =
if (TestPlatform.isJVM) Chunk(TestAspect.timeout(60.seconds), TestAspect.timed)
else Chunk(TestAspect.timeout(60.seconds), TestAspect.sequential, TestAspect.timed)
else if (TestPlatform.isNative) Chunk(TestAspect.timeout(300.seconds), TestAspect.timed, size(10))
else Chunk(TestAspect.timeout(300.seconds), TestAspect.sequential, TestAspect.timed, size(10))
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package experimental

import zio.prelude.experimental.laws._
import zio.prelude.laws._
import zio.test.TestAspect._
import zio.test._
import zio.test.laws._

Expand All @@ -15,5 +16,5 @@ object DistributiveProdSpec extends ZIOBaseSpec {
test("ParSeq distributive multiply")(checkAllLaws(DistributiveProdLaws)(Gens.parSeq(Gen.unit, Gen.int))),
test("fx.Cause distributive multiply")(checkAllLaws(DistributiveProdLaws)(Gens.parSeq(Gen.empty, Gen.int)))
)
)
) @@ exceptJVM(sequential)
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package zio.prelude.experimental

import zio._
import zio.test.TestAspect._
import zio.test._

trait ZIOBaseSpec extends ZIOSpecDefault {
override def aspects: Chunk[TestAspectAtLeastR[Environment with TestEnvironment]] =
if (TestPlatform.isJVM) Chunk(TestAspect.timeout(60.seconds), TestAspect.timed)
else Chunk(TestAspect.timeout(300.seconds), TestAspect.sequential, TestAspect.timed)
else if (TestPlatform.isNative) Chunk(TestAspect.timeout(300.seconds), TestAspect.timed, size(10))
else Chunk(TestAspect.timeout(300.seconds), TestAspect.sequential, TestAspect.timed, size(10))
}
13 changes: 10 additions & 3 deletions project/BuildHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import sbtbuildinfo.BuildInfoKeys.*
import sbtcrossproject.CrossPlugin.autoImport.*
import scalafix.sbt.ScalafixPlugin.autoImport.*

import scala.scalanative.sbtplugin.ScalaNativePlugin.autoImport._
import scala.scalanative.build.Mode
import scala.scalanative.sbtplugin.ScalaNativePlugin.autoImport.*

object BuildHelper {
val Scala212: String = "2.12.19"
Expand Down Expand Up @@ -243,8 +244,14 @@ object BuildHelper {
)

def nativeSettings = Seq(
nativeConfig ~= { _.withMultithreading(false) },
Test / fork := crossProjectPlatform.value == JVMPlatform // set fork to `true` on JVM to improve log readability, JS and Native need `false`
nativeConfig ~= { cfg =>
val os = System.getProperty("os.name").toLowerCase
// See https://github.com/zio/zio/releases/tag/v2.1.8
if (os.contains("mac")) cfg.withMode(Mode.releaseFast)
else cfg
},
Test / parallelExecution := false,
Test / fork := crossProjectPlatform.value == JVMPlatform // set fork to `true` on JVM to improve log readability, JS and Native need `false`
)

val scalaReflectTestSettings: List[Setting[_]] = List(
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ addSbtPlugin("ch.epfl.scala" % "sbt-bloop"
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.1")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.12.0")
addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.6.1")
addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.3.1")
addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "3.0.2")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.3")
Expand Down

0 comments on commit 336b20e

Please sign in to comment.