Skip to content

Commit

Permalink
Actually run the scala-cli test
Browse files Browse the repository at this point in the history
  • Loading branch information
keynmol committed Nov 5, 2023
1 parent addb48a commit 58612b4
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
*.class
*.tasty
.metals
.bloop
.bsp
.scala-build
.sbt
*.gch
.cache
*.out
c-playground
compile_commands.json
target
**/sbt-test/**/build.properties

**/target/**
project/project
project/metals.sbt

_site
docs/mdoc-invocation.txt
local-bindgen
bin
worktree-main
test-out
compile_flags.txt
build

*.o

Dockerfile
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ jobs:
./local_cli clang++ -v sqlite3 -- .github/workflows/fixtures/test-sqlite.c
./local_cli clang++ -v --manifest test-vcpkg.json -- .github/workflows/fixtures/test-sqlite.c
./local-cli scala-cli -v sqlite3 -- run .github/workflows/fixtures/test-scala-cli.scala
windows_build:
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/fixtures/test-scala-cli.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//> using dep "com.armanbilge::porcupine::0.0.1"
//> using platform scala-native
//> using scala 3.3.1

import porcupine.*
import cats.effect.IOApp
import cats.effect.IO
import cats.syntax.all.*
import scodec.bits.ByteVector

import Codec.*

object Test extends IOApp.Simple:
val run =
Database
.open[IO](":memory:")
.use: db =>
db.execute(sql"create table porcupine (n, i, r, t, b);".command) *>
db.execute(
sql"insert into porcupine values(${`null`}, $integer, $real, $text, $blob);".command,
(None, 42L, 3.14, "quill-pig", ByteVector(0, 1, 2, 3))
) *>
db.unique(
sql"select b, t, r, i, n from porcupine;"
.query(blob *: text *: real *: integer *: `null` *: nil)
).flatTap(IO.println)
.void
end Test

0 comments on commit 58612b4

Please sign in to comment.