From 58612b4a7adaa9298702f9d08b10733b2e70fe56 Mon Sep 17 00:00:00 2001 From: Anton Sviridov Date: Sun, 5 Nov 2023 09:50:52 +0000 Subject: [PATCH] Actually run the scala-cli test --- .dockerignore | 31 +++++++++++++++++++ .github/workflows/ci.yml | 1 + .../workflows/fixtures/test-scala-cli.scala | 28 +++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 .dockerignore create mode 100644 .github/workflows/fixtures/test-scala-cli.scala diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..eab7369 --- /dev/null +++ b/.dockerignore @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ebea980..dc6fe65 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: diff --git a/.github/workflows/fixtures/test-scala-cli.scala b/.github/workflows/fixtures/test-scala-cli.scala new file mode 100644 index 0000000..97af29f --- /dev/null +++ b/.github/workflows/fixtures/test-scala-cli.scala @@ -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