From 06c249c8de307b4a62040dd7cc76f9b007939fa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alan=20Artigao=20Carre=C3=B1o?= Date: Mon, 19 Feb 2024 13:16:54 +0100 Subject: [PATCH] Plugin dependencies under `sbt-typelevel` umbrella (#1297) * Plugins under sbt-typelevel umbrella * Bump to latest JDK and alter order to fix mdoc compilation * Fix `docs/run` execution condition in CI * Restrict `docs/run` execution in CI to JDK LTS --- .github/workflows/ci.yml | 72 ++++++++++++++++++++-------------------- build.sbt | 10 ++++-- project/plugins.sbt | 11 +++--- 3 files changed, 48 insertions(+), 45 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 35b2bc63f..32a74ec4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,12 +29,12 @@ jobs: matrix: os: [ubuntu-latest] scala: [2.12, 2.13, 3] - java: [temurin@8, temurin@17] + java: [temurin@21, temurin@8] exclude: - scala: 2.12 - java: temurin@17 + java: temurin@8 - scala: 3 - java: temurin@17 + java: temurin@8 runs-on: ${{ matrix.os }} timeout-minutes: 60 steps: @@ -43,30 +43,30 @@ jobs: with: fetch-depth: 0 - - name: Setup Java (temurin@8) - id: setup-java-temurin-8 - if: matrix.java == 'temurin@8' + - name: Setup Java (temurin@21) + id: setup-java-temurin-21 + if: matrix.java == 'temurin@21' uses: actions/setup-java@v4 with: distribution: temurin - java-version: 8 + java-version: 21 cache: sbt - name: sbt update - if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false' + if: matrix.java == 'temurin@21' && steps.setup-java-temurin-21.outputs.cache-hit == 'false' run: sbt +update - - name: Setup Java (temurin@17) - id: setup-java-temurin-17 - if: matrix.java == 'temurin@17' + - name: Setup Java (temurin@8) + id: setup-java-temurin-8 + if: matrix.java == 'temurin@8' uses: actions/setup-java@v4 with: distribution: temurin - java-version: 17 + java-version: 8 cache: sbt - name: sbt update - if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false' + if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false' run: sbt +update - name: Check that workflows are up to date @@ -74,7 +74,7 @@ jobs: - run: sbt '++ ${{ matrix.scala }}' ci - - if: matrix.scala == '2.13.12' + - if: matrix.scala == '2.13' && matrix.java == 'temurin@21' run: sbt '++ ${{ matrix.scala }}' docs/run publish: @@ -84,7 +84,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - java: [temurin@8] + java: [temurin@21] runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) @@ -92,30 +92,30 @@ jobs: with: fetch-depth: 0 - - name: Setup Java (temurin@8) - id: setup-java-temurin-8 - if: matrix.java == 'temurin@8' + - name: Setup Java (temurin@21) + id: setup-java-temurin-21 + if: matrix.java == 'temurin@21' uses: actions/setup-java@v4 with: distribution: temurin - java-version: 8 + java-version: 21 cache: sbt - name: sbt update - if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false' + if: matrix.java == 'temurin@21' && steps.setup-java-temurin-21.outputs.cache-hit == 'false' run: sbt +update - - name: Setup Java (temurin@17) - id: setup-java-temurin-17 - if: matrix.java == 'temurin@17' + - name: Setup Java (temurin@8) + id: setup-java-temurin-8 + if: matrix.java == 'temurin@8' uses: actions/setup-java@v4 with: distribution: temurin - java-version: 17 + java-version: 8 cache: sbt - name: sbt update - if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false' + if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false' run: sbt +update - name: Import signing key @@ -149,7 +149,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - java: [temurin@8] + java: [temurin@21] runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) @@ -157,30 +157,30 @@ jobs: with: fetch-depth: 0 - - name: Setup Java (temurin@8) - id: setup-java-temurin-8 - if: matrix.java == 'temurin@8' + - name: Setup Java (temurin@21) + id: setup-java-temurin-21 + if: matrix.java == 'temurin@21' uses: actions/setup-java@v4 with: distribution: temurin - java-version: 8 + java-version: 21 cache: sbt - name: sbt update - if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false' + if: matrix.java == 'temurin@21' && steps.setup-java-temurin-21.outputs.cache-hit == 'false' run: sbt +update - - name: Setup Java (temurin@17) - id: setup-java-temurin-17 - if: matrix.java == 'temurin@17' + - name: Setup Java (temurin@8) + id: setup-java-temurin-8 + if: matrix.java == 'temurin@8' uses: actions/setup-java@v4 with: distribution: temurin - java-version: 17 + java-version: 8 cache: sbt - name: sbt update - if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false' + if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false' run: sbt +update - name: Submit Dependencies diff --git a/build.sbt b/build.sbt index a343fd7cd..0ca809c38 100644 --- a/build.sbt +++ b/build.sbt @@ -207,16 +207,22 @@ lazy val metadataSettings = Seq( organization := "com.github.fd4s" ) +val OldGuardJava = JavaSpec.temurin("8") +val LTSJava = JavaSpec.temurin("21") + ThisBuild / githubWorkflowTargetBranches := Seq("series/*") ThisBuild / githubWorkflowBuild := Seq( WorkflowStep.Sbt(List("ci")), - WorkflowStep.Sbt(List("docs/run"), cond = Some(s"matrix.scala == '$scala213'")) + WorkflowStep.Sbt( + List("docs/run"), + cond = Some(s"matrix.scala == '2.13' && matrix.java == '${LTSJava.render}'") + ) ) ThisBuild / githubWorkflowArtifactUpload := false -ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("8"), JavaSpec.temurin("17")) +ThisBuild / githubWorkflowJavaVersions := Seq(LTSJava, OldGuardJava) ThisBuild / githubWorkflowPublish := Seq( WorkflowStep.Sbt( diff --git a/project/plugins.sbt b/project/plugins.sbt index 9bfc6dca2..5220aa473 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,7 +1,4 @@ -addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0") -addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0") -addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.3") -addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0") -addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.4.0") -addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") -addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.6.5") +val sbtTypelevelVersion = "0.6.5" +addSbtPlugin("org.typelevel" % "sbt-typelevel" % sbtTypelevelVersion) +addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % sbtTypelevelVersion) +addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")