Skip to content

Commit

Permalink
Merge branch 'main' into feature/fixtures
Browse files Browse the repository at this point in the history
# Conflicts:
#	build.sbt
  • Loading branch information
alejandrohdezma committed Apr 23, 2024
2 parents ee05afd + 3e53928 commit ce6fde9
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ changelog:
labels:
- ":chart_with_upwards_trend: dependency-update"
authors:
- alejandrohdezma-steward
- dependabot
categories:
- title: "⚠️ Breaking changes"
labels:
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
# Runs `sbt ci-test` on the project on differnt JDKs (this task should be added to the project as a command alias
# containing the necessary steps to compile, check formatters, launch tests...).
#
# An example of this `ci-test` alias can be found in https://github.com/alejandrohdezma/sbt-github/blob/main/build.sbt.
# Examples of this `ci-test` alias can be found [here](https://github.com/search?q=org%3Aalejandrohdezma+%22ci-test%22+path%3Abuild.sbt++NOT+is%3Aarchived&type=code).
#
# It will also do the following:
#
# - It will automatically label PRs based on head branch.
# - It will automatically enable auto-merge on `Scala Steward` PRs.
# - It will automatically enable auto-merge on `Scala Steward` PRs. You'll need to add a `STEWARD_BOT` repository or
# organization variable with the name of your scala-steward bot. See https://docs.github.com/en/actions/learn-github-actions/variables.

name: CI

Expand All @@ -34,7 +35,7 @@ jobs:
ci-steward:
if: |
github.event.pull_request.state == 'OPEN' && github.event.pull_request.head.repo.full_name == github.repository &&
github.event.pull_request.user.login == 'alejandrohdezma-steward[bot]'
github.event.pull_request.user.login == vars.STEWARD_BOT
name: (Scala Steward) Enable auto-merge
runs-on: ubuntu-latest
steps:
Expand All @@ -58,11 +59,11 @@ jobs:
- 17
steps:
- name: Checkout project
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ github.head_ref }}

- uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0
- uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
with:
distribution: "liberica"
java-version: ${{ matrix.jdk }}
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
# This workflow performs two tasks:
#
# - Creates a release of the project by running `sbt ci-publish` (this task should be added to the project as a command
# alias containing the necessary steps to do a release). An example of the `ci-publish` alias can be found in
# https://github.com/alejandrohdezma/sbt-github/blob/main/build.sbt.
# alias containing the necessary steps to do a release). Examples of this `ci-publish` alias can be found
# [here](https://github.com/search?q=org%3Aalejandrohdezma+%22ci-publish%22+path%3Abuild.sbt++NOT+is%3Aarchived&type=code).
#
# - Runs `sbt ci-docs` on the project and pushes a commit with the changes (the `ci-docs` task should be added to the
# project as a command alias containing the necessary steps to update documentation: re-generate docs files,
# publish websites, update headers...). An example of the `ci-docs` alias can be found in
# https://github.com/alejandrohdezma/sbt-github/blob/main/build.sbt.
# publish websites, update headers...). Examples of this `ci-docs` alias can be found
# [here](https://github.com/search?q=org%3Aalejandrohdezma+%22ci-docs%22+path%3Abuild.sbt++NOT+is%3Aarchived&type=code).
#
# This workflow will launch on pushed tags. Alternatively one can launch it manually using a "workflow dispatch" to
# create a snapshot release (this won't trigger the documentation update).
Expand All @@ -29,15 +29,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: Check latest tag follows semantic versioning
if: github.event_name == 'push'
uses: alejandrohdezma/actions/check-semver-tag@v1

- uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0
- uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
with:
distribution: "liberica"
java-version: "11"
Expand All @@ -59,13 +59,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
ref: main
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}

- uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0
- uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
with:
distribution: "liberica"
java-version: "17"
Expand Down
40 changes: 19 additions & 21 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
val Scala3 = "3.3.0" // scala-steward:off
ThisBuild / scalaVersion := "2.13.11"
ThisBuild / crossScalaVersions := Seq("2.12.18", "2.13.11", Scala3)
ThisBuild / scalaVersion := "2.13.13"
ThisBuild / crossScalaVersions := Seq("2.12.19", "2.13.13", Scala3)
ThisBuild / versionPolicyIntention := Compatibility.BinaryAndSourceCompatible

ThisBuild / organization := "com.alejandrohdezma"

addCommandAlias("ci-test", "fix --check; mdoc; +test")
addCommandAlias("ci-test", "fix --check; versionPolicyCheck; mdoc; +test")
addCommandAlias("ci-docs", "github; headerCreateAll; mdoc")
addCommandAlias("ci-publish", "github; ci-release")
addCommandAlias("ci-publish", "versionCheck; github; ci-release")

lazy val documentation = project
.enablePlugins(MdocPlugin)
.dependsOn(`http4s-munit` % "compile->test")
.settings(libraryDependencies += "org.http4s" %% "http4s-blaze-client" % "0.23.15")
.settings(libraryDependencies += "org.http4s" %% "http4s-blaze-client" % "0.23.16")

lazy val `http4s-munit` = module
.settings(Test / fork := true)
.settings(libraryDependencies += "org.scalameta" %% "munit" % "1.0.0-M8")
.settings(libraryDependencies += "org.http4s" %% "http4s-client" % "0.23.23")
.settings(libraryDependencies += "org.http4s" %% "http4s-dsl" % "0.23.23")
.settings(libraryDependencies += "org.http4s" %% "http4s-ember-client" % "0.23.23" % Optional)
.settings(libraryDependencies += "org.typelevel" %% "munit-cats-effect" % "2.0.0-M3")
.settings(libraryDependencies += "io.circe" %% "circe-parser" % "0.14.5")
.settings(libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.4.11" % Test)
.settings(libraryDependencies += "org.http4s" %% "http4s-circe" % "0.23.23" % Test)
.settings(libraryDependencies += "com.dimafeng" %% "testcontainers-scala-munit" % "0.41.0" % Test)
.settings(libraryDependencies += "org.http4s" %% "http4s-ember-client" % "0.23.23" % Test)
.settings(
libraryDependencies ++= CrossVersion
.partialVersion(scalaVersion.value)
.collect { case (2, _) => compilerPlugin("org.typelevel" % "kind-projector" % "0.13.2").cross(CrossVersion.full) }
.toList
)
.settings(libraryDependencies += "org.scalameta" %% "munit" % "0.7.29")
.settings(libraryDependencies += "org.http4s" %% "http4s-client" % "0.23.26")
.settings(libraryDependencies += "org.http4s" %% "http4s-dsl" % "0.23.26")
.settings(libraryDependencies += "org.http4s" %% "http4s-ember-client" % "0.23.26" % Optional)
.settings(libraryDependencies += "org.typelevel" %% "munit-cats-effect-3" % "1.0.7")
.settings(libraryDependencies += "io.circe" %% "circe-parser" % "0.14.6")
.settings(libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.5.5" % Test)
.settings(libraryDependencies += "org.http4s" %% "http4s-circe" % "0.23.26" % Test)
.settings(libraryDependencies += "com.dimafeng" %% "testcontainers-scala-munit" % "0.40.16" % Test)
.settings(libraryDependencies += "org.http4s" %% "http4s-ember-client" % "0.23.26" % Test)
.settings(libraryDependencies ++= scalaVersion.value.on(2)(kindProjector))

def kindProjector = compilerPlugin("org.typelevel" % "kind-projector" % "0.13.3").cross(CrossVersion.full)
18 changes: 9 additions & 9 deletions modules/http4s-munit/src/test/scala/munit/LogsSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ class LogsSuite extends FunSuite {
val obtained = execute[LogsSuite.SimpleSuite]

val expected =
s"""|==> Success GET -> posts
|==> Success GET -> posts/1
|==> Success GET -> posts/2 (get second post)
|==> Success GET -> posts/3 - executed 12 times with 5 in parallel
|==> Success GET -> posts/1 (get first post)
|==> Success GET -> posts/1 (get first post and then second post)
|==> Success GET -> posts/1 (get 1st post and 2nd secuentially)
|==> Success GET -> posts/1 (get first and second posts secuentially)
|""".stripMargin
"""|==> Success GET -> posts
|==> Success GET -> posts/1
|==> Success GET -> posts/2 (get second post)
|==> Success GET -> posts/3 - executed 12 times with 5 in parallel
|==> Success GET -> posts/1 (get first post)
|==> Success GET -> posts/1 (get first post and then second post)
|==> Success GET -> posts/1 (get 1st post and 2nd secuentially)
|==> Success GET -> posts/1 (get first and second posts secuentially)
|""".stripMargin

assertNoDiff(obtained, expected)
}
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.4
sbt.version=1.9.9
19 changes: 10 additions & 9 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.11.0")
addSbtPlugin("com.alejandrohdezma" % "sbt-ci" % "2.13.3")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.0")
addSbtPlugin("ch.epfl.scala" % "sbt-version-policy" % "3.2.0")
addSbtPlugin("com.alejandrohdezma" % "sbt-ci" % "2.15.0")
addSbtPlugin("com.alejandrohdezma" % "sbt-fix" % "0.7.1")
addSbtPlugin("com.alejandrohdezma" % "sbt-github-mdoc" % "0.11.11")
addSbtPlugin("com.alejandrohdezma" % "sbt-github-header" % "0.11.11")
addSbtPlugin("com.alejandrohdezma" % "sbt-scalafix-defaults" % "0.11.0")
addSbtPlugin("com.alejandrohdezma" % "sbt-github-mdoc" % "0.11.13")
addSbtPlugin("com.alejandrohdezma" % "sbt-github-header" % "0.11.13")
addSbtPlugin("com.alejandrohdezma" % "sbt-scalafix-defaults" % "0.12.0")
addSbtPlugin("com.alejandrohdezma" % "sbt-scalafmt-defaults" % "0.9.0")
addSbtPlugin("com.alejandrohdezma" % "sbt-modules" % "0.2.0")
addSbtPlugin("com.alejandrohdezma" % "sbt-modules" % "0.3.1")
addSbtPlugin("com.alejandrohdezma" % "sbt-mdoc-toc" % "0.4.1")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0")
addSbtPlugin("org.typelevel" % "sbt-tpolecat" % "0.5.0")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.3.7")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0")
addSbtPlugin("org.typelevel" % "sbt-tpolecat" % "0.5.1")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.5.2")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")

0 comments on commit ce6fde9

Please sign in to comment.