Skip to content

Commit

Permalink
fix build matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
ThijsBroersen committed Oct 6, 2024
1 parent 686d53d commit b5c4abc
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 35 deletions.
47 changes: 28 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ jobs:
timeout-minutes: 60
steps:
- name: Checkout current branch
uses: actions/checkout@v3.3.0
uses: actions/checkout@v4.2.0
- name: Setup Scala and Java
uses: olafurpg/setup-scala@v14
uses: actions/setup-java@v4.4.0
with:
distribution: temurin
java-version: 17
check-latest: true
- name: Cache scala dependencies
uses: coursier/cache-action@v6
- name: Check Document Generation
Expand All @@ -32,32 +36,33 @@ jobs:
strategy:
fail-fast: false
matrix:
java: ['adopt@1.8', 'adopt@1.11']
java: ['17']
scala: ['2.12.20', '2.13.15', '3.4.3']
platform: ['JS', 'JVM', 'Native']
steps:
- name: Checkout current branch
uses: actions/checkout@v3.3.0
uses: actions/checkout@v4.2.0
with:
fetch-depth: 0
- name: Setup Scala and Java
uses: olafurpg/setup-scala@v14
uses: actions/setup-java@v4.4.0
with:
distribution: temurin
java-version: ${{ matrix.java }}
check-latest: true
- name: Cache scala dependencies
uses: coursier/cache-action@v6
- name: Run JS tests
if: ${{ matrix.platform == 'JS' && !startsWith(matrix.scala, '3.') }}
run: sbt ++${{ matrix.scala }}! testJS
- name: Run 2.12 JVM tests
if: ${{ matrix.platform == 'JVM' && startsWith(matrix.scala, '2.12') }}
run: sbt ++${{ matrix.scala }}! testJVM212
- name: Run 2.13 JVM tests
if: ${{ matrix.platform == 'JVM' && startsWith(matrix.scala, '2.13') }}
run: sbt ++${{ matrix.scala }}! testJVM213
- name: Run 3.x JVM tests
if: ${{ matrix.platform == 'JVM' && startsWith(matrix.scala, '3.') }}
run: sbt ++${{ matrix.scala }}! testJVM3x
- name: Run ${{ matrix.scala }} ${{ matrix.platform }} tests
run: |
SCALA_SUFFIX=""
if [[ ${{ matrix.scala }} == 2.12* ]]; then
SCALA_SUFFIX="212"
elif [[ ${{ matrix.scala }} == 2.13* ]]; then
SCALA_SUFFIX="213"
elif [[ ${{ matrix.scala }} == 3.* ]]; then
SCALA_SUFFIX="3"
fi
sbt test${{ matrix.platform }}${SCALA_SUFFIX}
ci:
runs-on: ubuntu-22.04
Expand All @@ -73,11 +78,15 @@ jobs:
if: github.event_name != 'pull_request'
steps:
- name: Checkout current branch
uses: actions/checkout@v3.3.0
uses: actions/checkout@v4.2.0
with:
fetch-depth: 0
- name: Setup Scala and Java
uses: olafurpg/setup-scala@v14
uses: actions/setup-java@v4.4.0
with:
distribution: temurin
java-version: 17
check-latest: true
- name: Cache scala dependencies
uses: coursier/cache-action@v6
- name: Release artifacts
Expand Down
68 changes: 52 additions & 16 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@ addCommandAlias(
"testJS",
";" + jsProjects.map(_.id).mkString("/test;") + "/test"
)
addCommandAlias(
"testJS212",
";" + scala212JSprojects.map(_.id).mkString("/test;") + "/test"
)
addCommandAlias(
"testJS213",
";" + scala213JSprojects.map(_.id).mkString("/test;") + "/test"
)
addCommandAlias(
"testJS3",
";" + scala3JSprojects.map(_.id).mkString("/test;") + "/test"
)
addCommandAlias(
"testJVM",
";" + jvmProjects.map(_.id).mkString("/test;") + "/test"
)
addCommandAlias(
"testJVM212",
";" + scala212JVMprojects.map(_.id).mkString("/test;") + "/test"
Expand All @@ -41,17 +57,25 @@ addCommandAlias(
";" + scala213JVMprojects.map(_.id).mkString("/test;") + "/test"
)
addCommandAlias(
"testJVM3x",
"testJVM3",
";" + scala3JVMprojects.map(_.id).mkString("/test;") + "/test"
)
addCommandAlias(
"testJVM",
";" + jvmProjects.map(_.id).mkString("/test;") + "/test"
)
addCommandAlias(
"testNative",
";" + nativeProjects.map(_.id).mkString("/test;") + "/test"
)
addCommandAlias(
"testNative212",
";" + scala212NativeProjects.map(_.id).mkString("/test;") + "/test"
)
addCommandAlias(
"testNative213",
";" + scala213NativeProjects.map(_.id).mkString("/test;") + "/test"
)
addCommandAlias(
"testNative3",
";" + scala3NativeProjects.map(_.id).mkString("/test;") + "/test"
)

val awsVersion = "1.12.773"
val zioAwsVersion = "7.21.15.15"
Expand Down Expand Up @@ -101,17 +125,29 @@ lazy val jvmProjects = allProjects.flatMap(_.filterProjects(Seq(VirtualAxis.j
lazy val jsProjects = allProjects.flatMap(_.filterProjects(Seq(VirtualAxis.js)))
lazy val nativeProjects = allProjects.flatMap(_.filterProjects(Seq(VirtualAxis.native)))

lazy val scala212projects = allProjects.flatMap(_.filterProjects(Seq(VirtualAxis.scalaVersionAxis("2.12.20", ""))))
lazy val scala212JVMprojects =
allProjects.flatMap(_.filterProjects(Seq(VirtualAxis.jvm, VirtualAxis.scalaVersionAxis("2.12.20", ""))))

lazy val scala213projects = allProjects.flatMap(_.filterProjects(Seq(VirtualAxis.scalaVersionAxis("2.13.15", ""))))
lazy val scala213JVMprojects =
allProjects.flatMap(_.filterProjects(Seq(VirtualAxis.jvm, VirtualAxis.scalaVersionAxis("2.13.15", ""))))

lazy val scala3projects = allProjects.flatMap(_.filterProjects(Seq(VirtualAxis.scalaVersionAxis("3.4.3", ""))))
lazy val scala3JVMprojects =
allProjects.flatMap(_.filterProjects(Seq(VirtualAxis.jvm, VirtualAxis.scalaVersionAxis("3.4.3", ""))))
lazy val scala212projects = allProjects.flatMap(_.filterProjects(Seq(VirtualAxis.scalaVersionAxis(Scala212, ""))))
lazy val scala212JVMprojects =
allProjects.flatMap(_.filterProjects(Seq(VirtualAxis.jvm, VirtualAxis.scalaVersionAxis(Scala212, ""))))
lazy val scala212JSprojects =
allProjects.flatMap(_.filterProjects(Seq(VirtualAxis.js, VirtualAxis.scalaVersionAxis(Scala212, ""))))
lazy val scala212NativeProjects =
allProjects.flatMap(_.filterProjects(Seq(VirtualAxis.native, VirtualAxis.scalaVersionAxis(Scala212, ""))))

lazy val scala213projects = allProjects.flatMap(_.filterProjects(Seq(VirtualAxis.scalaVersionAxis(Scala213, ""))))
lazy val scala213JVMprojects =
allProjects.flatMap(_.filterProjects(Seq(VirtualAxis.jvm, VirtualAxis.scalaVersionAxis(Scala213, ""))))
lazy val scala213JSprojects =
allProjects.flatMap(_.filterProjects(Seq(VirtualAxis.js, VirtualAxis.scalaVersionAxis(Scala213, ""))))
lazy val scala213NativeProjects =
allProjects.flatMap(_.filterProjects(Seq(VirtualAxis.native, VirtualAxis.scalaVersionAxis(Scala213, ""))))

lazy val scala3projects = allProjects.flatMap(_.filterProjects(Seq(VirtualAxis.scalaVersionAxis(Scala3, ""))))
lazy val scala3JVMprojects =
allProjects.flatMap(_.filterProjects(Seq(VirtualAxis.jvm, VirtualAxis.scalaVersionAxis(Scala3, ""))))
lazy val scala3JSprojects =
allProjects.flatMap(_.filterProjects(Seq(VirtualAxis.js, VirtualAxis.scalaVersionAxis(Scala3, ""))))
lazy val scala3NativeProjects =
allProjects.flatMap(_.filterProjects(Seq(VirtualAxis.native, VirtualAxis.scalaVersionAxis(Scala3, ""))))

lazy val root =
project
Expand Down

0 comments on commit b5c4abc

Please sign in to comment.