From b5c4abcf32f61dc4bc67bcda8886669270fcc964 Mon Sep 17 00:00:00 2001 From: Thijs Broersen Date: Sun, 6 Oct 2024 19:19:15 +0200 Subject: [PATCH] fix build matrix --- .github/workflows/ci.yml | 47 ++++++++++++++++----------- build.sbt | 68 ++++++++++++++++++++++++++++++---------- 2 files changed, 80 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ffc86c9e..55f2161bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 @@ -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 diff --git a/build.sbt b/build.sbt index 700dc2c2d..0de2bfc1e 100644 --- a/build.sbt +++ b/build.sbt @@ -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" @@ -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" @@ -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