Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make freeGen2 run manually (but verified by CI) #1960

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
run: sbt githubWorkflowCheck

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

- name: Check binary compatibility
if: matrix.java == 'temurin@11' && matrix.os == 'ubuntu-latest'
Expand Down
42 changes: 42 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Developing Doobie

Doobie is a multi-module SBT project.
There is some code generation (project/FreeGen2.scala) which generates the free algebra (e.g. kleisliinterpreter.scala)
from JDBC driver classes definitions.

Running the tests or building the documentation site requires connection to the example Postgres docker contains,
which you can spin up using docker-compose:

```
docker-compose up -d --force-update
```

After that, in SBT you can run `test` to run tests, and `makeSite` to build the doc site

If you're editing code generation related code, you should reload the SBT project and then run the `freeGen2` SBT task
before compiling or running tests.

# Publishing

### Snapshots

doobie uses [sbt-ci-release](https://github.com/olafurpg/sbt-ci-release) which means all merges to `master` are pushed to Sonatype as snapshots and there's nothing to do.

### Releases

To make a release, make sure you're on the right commit, then tag it using the format here. This will trigger a release build.

```bash
git tag -a v1.2.3 -m v1.2.3
git push --tags
```

To update the doc site, check out the tag first.

```
git checkout v1.2.3
sbt docs/publishMicrosite
```



25 changes: 0 additions & 25 deletions PUBLISHING.md

This file was deleted.

4 changes: 4 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ ThisBuild / githubWorkflowBuildPreamble ++= Seq(
name = Some("Check Headers"),
),
)
ThisBuild / githubWorkflowBuild := {
val current = (ThisBuild / githubWorkflowBuild).value
current.updated(0, WorkflowStep.Sbt(List("freeGen2", "test"), name = Some("Test")))
}
ThisBuild / githubWorkflowBuildPostamble ++= Seq(
WorkflowStep.Sbt(
commands = List("checkGitNoUncommittedChanges"),
Expand Down
11 changes: 7 additions & 4 deletions project/FreeGen2.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import sbt._, Keys._
import java.lang.reflect._
import sbt.*
import Keys.*

import java.lang.reflect.*
import scala.reflect.ClassTag
import Predef._
import Predef.*
import org.typelevel.sbt.gha.GenerativeKeys.githubWorkflowBuild
import org.typelevel.sbt.gha.GenerativePlugin.autoImport.WorkflowStep

object FreeGen2 {

Expand All @@ -26,7 +30,6 @@ object FreeGen2 {
freeGen2KleisliInterpreterImportExcludes.value,
state.value.log
).gen(freeGen2Dir.value),
Compile / compile := (Compile / compile).dependsOn(freeGen2).value
)

}
Expand Down