Skip to content

Commit

Permalink
Update sbt-typelevel to 0.5.2 (#611)
Browse files Browse the repository at this point in the history
* Update sbt-typelevel to 0.5.2

* Run prePR with sbt-typelevel

Executed command: sbt tlPrePrBotHook

* removed spurious q

* no need for kind-projector explicitly, sbt-typelevel brings it in

* fmt

* nowarn for scala 3

* nowanr nowarn for scala 2

---------

Co-authored-by: Julien Jean Paul Sirocchi <julien.sirocchi@gmail.com>
  • Loading branch information
scala-steward and sirocchj authored Sep 15, 2023
1 parent 5e11b6f commit d657843
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 103 deletions.
181 changes: 101 additions & 80 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,72 +15,55 @@ on:
tags: [v*]

env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


concurrency:
group: ${{ github.workflow }} @ ${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build and Test
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.18, 2.13.12, 3.3.1]
scala: [2.12, 2.13, 3]
java: [temurin@11, temurin@17]
project: [rootJVM]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download Java (temurin@11)
id: download-java-temurin-11
if: matrix.java == 'temurin@11'
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 11

- name: Setup Java (temurin@11)
id: setup-java-temurin-11
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v3
with:
distribution: jdkfile
distribution: temurin
java-version: 11
jdkFile: ${{ steps.download-java-temurin-11.outputs.jdkFile }}
cache: sbt

- name: Download Java (temurin@17)
id: download-java-temurin-17
if: matrix.java == 'temurin@17'
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 17
- name: sbt update
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
run: sbt +update

- name: Setup Java (temurin@17)
id: setup-java-temurin-17
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v3
with:
distribution: jdkfile
distribution: temurin
java-version: 17
jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }}
cache: sbt

- name: Cache sbt
uses: actions/cache@v3
with:
path: |
~/.sbt
~/.ivy2/cache
~/.coursier/cache/v1
~/.cache/coursier/v1
~/AppData/Local/Coursier/Cache/v1
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
- name: sbt update
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
run: sbt +update

- name: Check that workflows are up to date
run: sbt githubWorkflowCheck
Expand All @@ -102,11 +85,11 @@ jobs:

- name: Make target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master')
run: mkdir -p fs2/target target .js/target .jvm/target zio/target .native/target core/target interop/target project/target
run: mkdir -p fs2/target zio/target core/target interop/target project/target

- name: Compress target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master')
run: tar cf targets.tar fs2/target target .js/target .jvm/target zio/target .native/target core/target interop/target project/target
run: tar cf targets.tar fs2/target zio/target core/target interop/target project/target

- name: Upload target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master')
Expand All @@ -126,94 +109,132 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download Java (temurin@11)
id: download-java-temurin-11
if: matrix.java == 'temurin@11'
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 11

- name: Setup Java (temurin@11)
id: setup-java-temurin-11
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v3
with:
distribution: jdkfile
distribution: temurin
java-version: 11
jdkFile: ${{ steps.download-java-temurin-11.outputs.jdkFile }}
cache: sbt

- name: Download Java (temurin@17)
id: download-java-temurin-17
if: matrix.java == 'temurin@17'
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 17
- name: sbt update
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
run: sbt +update

- name: Setup Java (temurin@17)
id: setup-java-temurin-17
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v3
with:
distribution: jdkfile
distribution: temurin
java-version: 17
jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }}
cache: sbt

- name: Cache sbt
uses: actions/cache@v3
with:
path: |
~/.sbt
~/.ivy2/cache
~/.coursier/cache/v1
~/.cache/coursier/v1
~/AppData/Local/Coursier/Cache/v1
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: Download target directories (2.12.18, rootJVM)
- name: sbt update
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
run: sbt +update

- name: Download target directories (2.12, rootJVM)
uses: actions/download-artifact@v3
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.18-rootJVM
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootJVM

- name: Inflate target directories (2.12.18, rootJVM)
- name: Inflate target directories (2.12, rootJVM)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.13.12, rootJVM)
- name: Download target directories (2.13, rootJVM)
uses: actions/download-artifact@v3
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.12-rootJVM
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootJVM

- name: Inflate target directories (2.13.12, rootJVM)
- name: Inflate target directories (2.13, rootJVM)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (3.3.1, rootJVM)
- name: Download target directories (3, rootJVM)
uses: actions/download-artifact@v3
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-3.3.1-rootJVM
name: target-${{ matrix.os }}-${{ matrix.java }}-3-rootJVM

- name: Inflate target directories (3.3.1, rootJVM)
- name: Inflate target directories (3, rootJVM)
run: |
tar xf targets.tar
rm targets.tar
- name: Import signing key
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
run: echo $PGP_SECRET | base64 -di | gpg --import

- name: Import signing key and strip passphrase
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != ''
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
run: |
echo "$PGP_SECRET" | base64 -di > /tmp/signing-key.gpg
echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
(echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1)
- name: Publish
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }}
run: sbt tlCiRelease

dependency-submission:
name: Submit Dependencies
if: github.event_name != 'pull_request'
strategy:
matrix:
os: [ubuntu-latest]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Java (temurin@11)
id: setup-java-temurin-11
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
run: sbt +update

- name: Setup Java (temurin@17)
id: setup-java-temurin-17
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
run: sbt +update

- name: Submit Dependencies
uses: scalacenter/sbt-dependency-submission@v2
with:
modules-ignore: rootjs_2.12 rootjs_2.13 rootjs_3 rootjvm_2.12 rootjvm_2.13 rootjvm_3 rootnative_2.12 rootnative_2.13 rootnative_3
configs-ignore: test scala-tool scala-doc-tool test-internal
30 changes: 10 additions & 20 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@ val scala_213 = "2.13.12"
val scala_3 = "3.3.1"

val versionOf = new {
val cats = "2.10.0"
val catsEffect = "3.5.1"
val fs2 = "3.9.2"
val kindProjector = "0.13.2"
val log4cats = "2.6.0"
val log4s = "1.10.0"
val scalaCheck = "1.17.0"
val scalaTest = "3.2.17"
val zio = "2.0.16"
val scribe = "3.12.2"
val cats = "2.10.0"
val catsEffect = "3.5.1"
val fs2 = "3.9.2"
val log4cats = "2.6.0"
val log4s = "1.10.0"
val scalaCheck = "1.17.0"
val scalaTest = "3.2.17"
val zio = "2.0.16"
val scribe = "3.12.2"
}

lazy val coreDependencies = Seq(
Expand Down Expand Up @@ -44,13 +43,7 @@ lazy val testDependencies = Seq(
"org.scalacheck" %% "scalacheck" % versionOf.scalaCheck % Test,
"org.scalatest" %% "scalatest" % versionOf.scalaTest % Test,
"org.log4s" %% "log4s-testing" % versionOf.log4s % Test
)

lazy val compilerPluginsDependencies = Seq(
compilerPlugin(
"org.typelevel" %% "kind-projector" % versionOf.kindProjector cross CrossVersion.full
)
)
).map(_.withSources)

ThisBuild / tlBaseVersion := "0.17"
ThisBuild / tlCiReleaseBranches := Seq("master")
Expand All @@ -69,9 +62,6 @@ ThisBuild / githubWorkflowBuildMatrixExclusions := Seq()
ThisBuild / Test / parallelExecution := false

ThisBuild / libraryDependencies ++= testDependencies
ThisBuild / libraryDependencies ++= {
if (tlIsScala3.value) Seq.empty else compilerPluginsDependencies
}

lazy val root = tlCrossRootProject
.aggregate(core, fs2, zio, interop)
Expand Down
3 changes: 1 addition & 2 deletions interop/src/test/scala/InteropTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ object RedisClient {
)(_ => F.unit)
}

@nowarn("msg=local method [a-zA-Z0-9]+ in value <local InteropTest> is never used")
final class InteropTest extends AnyWordSpecLike with Matchers with TestLogCapture {

"A LogWriter instance can be derived from a log4cats Logger" in {
Expand Down Expand Up @@ -100,7 +99,7 @@ final class InteropTest extends AnyWordSpecLike with Matchers with TestLogCaptur

def buildLog4catsLogger[F[_]]: F[Logger[F]] = ???

def storeOwnAddress[F[_]: Sync](address: String): F[Unit] =
@nowarn def storeOwnAddress[F[_]: Sync](address: String): F[Unit] =
buildLog4catsLogger[F] >>= { implicit l =>
RedisClient[F](address).use { cl =>
cl.write
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.4.22")
addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.5.2")

0 comments on commit d657843

Please sign in to comment.