Skip to content

Commit

Permalink
Rename example projects
Browse files Browse the repository at this point in the history
  • Loading branch information
neko-kai committed Jun 20, 2024
1 parent b485bf1 commit 9a64662
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Build native app
run: sbt "project leaderboard-bifunctor-tf; GraalVMNativeImage/packageBin"
run: sbt "project bifunctor-tagless; GraalVMNativeImage/packageBin"
- name: Check native app
run: ./distage-example-bifunctor-tf/target/graalvm-native-image/leaderboard-bifunctor-tf :help
run: ./bifunctor-tagless/target/graalvm-native-image/bifunctor-tagless :help
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ Features [distage](https://izumi.7mind.io/distage/) for dependency injection,
[ZIO Environment](https://zio.dev) for composing test fixtures,
and [distage-framework-docker](https://izumi.7mind.io/distage/distage-framework-docker) for setting up test containers.

Code for the main example is in [distage-example-bifunctor-tf](distage-example-bifunctor-tf) directory. It's written in bifunctor tagless final style with [BIO](https://izumi.7mind.io/bio/) typeclasses, uses [ZIO](https://zio.dev) as a runtime and ZIO Environment for composing test fixtures.
Code for the main example is in [bifunctor-tagless](bifunctor-tagless) directory. It's written in bifunctor tagless final style with [BIO](https://izumi.7mind.io/bio/) typeclasses, uses [ZIO](https://zio.dev) as a runtime and ZIO Environment for composing test fixtures.

There are also two variants of the example project:

- [distage-example-monofunctor-tf](distage-example-monofunctor-tf) – Written in monofunctor tagless final style with [Cats Effect](https://typelevel.org/cats-effect/) typeclasses, and can run using both [Cats IO](https://typelevel.org/cats-effect/) and [ZIO](https://zio.dev) runtimes.
- [distage-example-monomorphic-cats](distage-example-monomorphic-cats) – A simpler example written without tagless final, uses [Cats IO]() directly everywhere.
- [monofunctor-tagless](monofunctor-tagless) – Written in monofunctor tagless final style with [Cats Effect](https://typelevel.org/cats-effect/) typeclasses, and can run using both [Cats IO](https://typelevel.org/cats-effect/) and [ZIO](https://zio.dev) runtimes.
- [monomorphic-cats](monomorphic-cats) – A simpler example written without tagless final, uses [Cats IO]() directly everywhere.

To launch tests that require postgres ensure you have a `docker` daemon running in the background.

Expand Down Expand Up @@ -63,21 +63,21 @@ Both of them should have `Active: active (running)` status. If your problem isn'
Use `sbt` to build a native Linux binary with GraalVM NativeImage under Docker:

```bash
sbt leaderboard-bifunctor-tf/GraalVMNativeImage/packageBin
sbt bifunctor-tagless/GraalVMNativeImage/packageBin
```

If you want to build the app using local `native-image` executable (e.g. on a Mac), comment out the `graalVMNativeImageGraalVersion` key in `build.sbt` first.

To test the native app with dummy repositories run:

```bash
./distage-example-bifunctor-tf/target/graalvm-native-image/leaderboard -u scene:managed -u repo:dummy :leaderboard
./bifunctor-tagless/target/graalvm-native-image/bifunctor-tagless -u scene:managed -u repo:dummy :leaderboard
```

To test the native app with production repositories in Docker run:

```bash
./distage-example-bifunctor-tf/target/graalvm-native-image/leaderboard -u scene:managed -u repo:prod :leaderboard
./bifunctor-tagless/target/graalvm-native-image/bifunctor-tagless -u scene:managed -u repo:prod :leaderboard
```

Notes:
Expand Down
18 changes: 9 additions & 9 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,16 @@ inThisBuild(
)
)

lazy val `leaderboard-bifunctor-tf` = project
.in(file("distage-example-bifunctor-tf"))
lazy val `bifunctor-tagless` = project
.in(file("bifunctor-tagless"))
.pipe(sharedSettings(Seq(Deps.zio, Deps.zioCats)))

lazy val `leaderboard-monofunctor-tf` = project
.in(file("distage-example-monofunctor-tf"))
lazy val `monofunctor-tagless` = project
.in(file("monofunctor-tagless"))
.pipe(sharedSettings(Seq(Deps.zio, Deps.zioCats)))

lazy val `leaderboard-monomorphic-cats` = project
.in(file("distage-example-monomorphic-cats"))
lazy val `monomorphic-cats` = project
.in(file("monomorphic-cats"))
.pipe(sharedSettings(Seq()))

lazy val `graal-resources` = project
Expand All @@ -98,9 +98,9 @@ lazy val `graal-resources` = project
lazy val `distage-example` = project
.in(file("."))
.aggregate(
`leaderboard-bifunctor-tf`,
`leaderboard-monofunctor-tf`,
`leaderboard-monomorphic-cats`,
`bifunctor-tagless`,
`monofunctor-tagless`,
`monomorphic-cats`,
`graal-resources`,
)
.enablePlugins(GraalVMNativeImagePlugin, UniversalPlugin)
Expand Down
2 changes: 1 addition & 1 deletion launcher
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

ARGS="$@"

sbt "project leaderboard-bifunctor-tf; runMain leaderboard.GenericLauncher $ARGS"
sbt "project bifunctor-tagless; runMain leaderboard.GenericLauncher $ARGS"

0 comments on commit 9a64662

Please sign in to comment.