Skip to content

Commit

Permalink
Merge pull request #17 from Prillan/cats-effect-3.5
Browse files Browse the repository at this point in the history
bump versions, adapt to Cats Effect 3.5.x
  • Loading branch information
armanbilge authored Jul 4, 2023
2 parents eea6f10 + cd4e861 commit 3c8e590
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 79 deletions.
117 changes: 50 additions & 67 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ name: Continuous Integration

on:
pull_request:
branches: ['**']
branches: ['**', '!update/**', '!pr/**']
push:
branches: ['**']
branches: ['**', '!update/**', '!pr/**']
tags: [v*]

env:
Expand All @@ -29,35 +29,35 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
scala: [2.12.15, 2.13.8, 3.1.2]
scala: [2.12.18, 2.13.11, 3.3.0]
java: [temurin@8, temurin@11, temurin@17]
exclude:
- scala: 2.12.15
- scala: 2.12.18
java: temurin@11
- scala: 2.12.15
- scala: 2.12.18
java: temurin@17
- scala: 3.1.2
- scala: 3.3.0
java: temurin@11
- scala: 3.1.2
- scala: 3.3.0
java: temurin@17
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

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

- name: Setup Java (temurin@8)
if: matrix.java == 'temurin@8'
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 8
Expand All @@ -66,14 +66,14 @@ jobs:
- name: Download Java (temurin@11)
id: download-java-temurin-11
if: matrix.java == 'temurin@11'
uses: typelevel/download-java@v1
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 11

- name: Setup Java (temurin@11)
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 11
Expand All @@ -82,21 +82,21 @@ jobs:
- name: Download Java (temurin@17)
id: download-java-temurin-17
if: matrix.java == 'temurin@17'
uses: typelevel/download-java@v1
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 17

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

- name: Cache sbt
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.sbt
Expand All @@ -108,26 +108,30 @@ jobs:
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: Check that workflows are up to date
run: sbt '++${{ matrix.scala }}' 'project /' githubWorkflowCheck
run: sbt githubWorkflowCheck

- name: Check headers and formatting
if: matrix.java == 'temurin@8'
run: sbt '++${{ matrix.scala }}' headerCheckAll scalafmtCheckAll 'project /' scalafmtSbtCheck
if: matrix.java == 'temurin@8' && matrix.os == 'ubuntu-latest'
run: sbt '++ ${{ matrix.scala }}' headerCheckAll scalafmtCheckAll 'project /' scalafmtSbtCheck

- name: Test
run: sbt '++${{ matrix.scala }}' test
run: sbt '++ ${{ matrix.scala }}' test

- name: Check binary compatibility
if: matrix.java == 'temurin@8'
run: sbt '++${{ matrix.scala }}' mimaReportBinaryIssues
if: matrix.java == 'temurin@8' && matrix.os == 'ubuntu-latest'
run: sbt '++ ${{ matrix.scala }}' mimaReportBinaryIssues

- name: Generate API documentation
if: matrix.java == 'temurin@8'
run: sbt '++${{ matrix.scala }}' doc
if: matrix.java == 'temurin@8' && matrix.os == 'ubuntu-latest'
run: sbt '++ ${{ matrix.scala }}' doc

- name: Check scalafix lints
if: matrix.java == 'temurin@8' && !startsWith(matrix.scala, '3.')
run: sbt '++ ${{ matrix.scala }}' 'scalafixAll --check'

- name: Check unused compile dependencies
if: matrix.java == 'temurin@8'
run: sbt '++${{ matrix.scala }}' unusedCompileDependenciesTest
run: sbt '++ ${{ matrix.scala }}' unusedCompileDependenciesTest

- name: Make target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
Expand All @@ -139,7 +143,7 @@ jobs:

- name: Upload target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}
path: targets.tar
Expand All @@ -151,26 +155,25 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.8]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

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

- name: Setup Java (temurin@8)
if: matrix.java == 'temurin@8'
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 8
Expand All @@ -179,14 +182,14 @@ jobs:
- name: Download Java (temurin@11)
id: download-java-temurin-11
if: matrix.java == 'temurin@11'
uses: typelevel/download-java@v1
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 11

- name: Setup Java (temurin@11)
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 11
Expand All @@ -195,21 +198,21 @@ jobs:
- name: Download Java (temurin@17)
id: download-java-temurin-17
if: matrix.java == 'temurin@17'
uses: typelevel/download-java@v1
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 17

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

- name: Cache sbt
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.sbt
Expand All @@ -220,52 +223,32 @@ jobs:
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: Download target directories (2.12.15)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.15

- name: Inflate target directories (2.12.15)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.13.8)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8

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

- name: Inflate target directories (2.13.8)
- name: Inflate target directories (2.12.18)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.13.8)
uses: actions/download-artifact@v2
- name: Download target directories (2.13.11)
uses: actions/download-artifact@v3
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.11

- name: Inflate target directories (2.13.8)
- name: Inflate target directories (2.13.11)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (3.1.2)
uses: actions/download-artifact@v2
- name: Download target directories (3.3.0)
uses: actions/download-artifact@v3
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.2
name: target-${{ matrix.os }}-${{ matrix.java }}-3.3.0

- name: Inflate target directories (3.1.2)
- name: Inflate target directories (3.3.0)
run: |
tar xf targets.tar
rm targets.tar
Expand All @@ -282,4 +265,4 @@ jobs:
(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
run: sbt '++${{ matrix.scala }}' tlRelease
run: sbt tlCiRelease
3 changes: 3 additions & 0 deletions .scalafix.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rules = [
NoValInForComprehension
]
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ object AsyncHttpClient {
F.delay(
httpClient
.executeRequest(toAsyncRequest(req, dispatcher), asyncHandler(cb, dispatcher))
).as(None)
).map { future =>
Some(F.blocking(future.cancel(true)).void)
}
})
}

Expand Down
17 changes: 7 additions & 10 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@ ThisBuild / developers := List(
tlGitHubDev("rossabaker", "Ross A. Baker")
)

val Scala213 = "2.13.8"
ThisBuild / crossScalaVersions := Seq("2.12.15", Scala213, "3.1.2")
val Scala213 = "2.13.11"
ThisBuild / crossScalaVersions := Seq("2.12.18", Scala213, "3.3.0")
ThisBuild / scalaVersion := Scala213

lazy val root = project.in(file(".")).aggregate(asyncHttpClient).enablePlugins(NoPublishPlugin)

val http4sVersion = "0.23.11"
val http4sVersion = "0.23.22"
val asyncHttpClientVersion = "2.12.3"
val fs2Version = "3.2.7"
val nettyVersion = "4.1.77.Final"
val reactiveStreamsVersion = "1.0.3"

ThisBuild / resolvers +=
"s01 snapshots".at("https://s01.oss.sonatype.org/content/repositories/snapshots/")
val fs2Version = "3.7.0"
val nettyVersion = "4.1.94.Final"
val reactiveStreamsVersion = "1.0.4"

lazy val asyncHttpClient = project
.in(file("async-http-client"))
Expand All @@ -32,6 +29,6 @@ lazy val asyncHttpClient = project
"io.netty" % "netty-buffer" % nettyVersion,
"io.netty" % "netty-codec-http" % nettyVersion,
"org.reactivestreams" % "reactive-streams" % reactiveStreamsVersion,
"org.http4s" %% "http4s-client-testkit" % "0.23.11-473-e7e64cb-SNAPSHOT" % Test,
"org.http4s" %% "http4s-client-testkit" % http4sVersion % Test,
),
)
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
addSbtPlugin("org.http4s" % "sbt-http4s-org" % "0.13.2")
addSbtPlugin("org.http4s" % "sbt-http4s-org" % "0.14.13")

0 comments on commit 3c8e590

Please sign in to comment.