Skip to content

Commit

Permalink
Fix cli flags output (#150)
Browse files Browse the repository at this point in the history
* Fix flags output
* Verbose CLI printing
* Output flags in CLI tests
* Actually run the scala-cli test
* Macos 12
  • Loading branch information
keynmol authored Nov 5, 2023
1 parent c05230d commit 826100b
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 18 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
30 changes: 13 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-11]
os: [ubuntu-20.04, macos-12]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -55,29 +55,32 @@ jobs:
cd example
SBT_VCPKG_VERSION=$(cat ../version) sbt example/run
- uses: coursier/cache-action@v6
- uses: VirtusLab/scala-cli-setup@main

- name: CLI tests
shell: bash
run: |
set -e
set -xe
curl -fLo cs https://github.com/coursier/launchers/raw/master/coursier &&
chmod +x cs
curl -fLo cs https://github.com/coursier/launchers/raw/master/coursier && chmod +x cs
./cs bootstrap com.indoorvivants.vcpkg:sn-vcpkg_3:$(cat version) -f -o local_cli
./local_cli bootstrap
./local_cli install -v libpq s2n
./local_cli install -v -c -l libpq s2n
echo '{"name": "my-application","version": "0.15.2","dependencies": ["sqlite3"]}' > test-vcpkg.json
./local_cli install --manifest test-vcpkg.json
./local_cli install -v -c -l --manifest test-vcpkg.json
./local_cli clang sqlite3 -- .github/workflows/fixtures/test-sqlite.c
./local_cli clang --manifest test-vcpkg.json -- .github/workflows/fixtures/test-sqlite.c
./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 clang++ sqlite3 -- .github/workflows/fixtures/test-sqlite.c
./local_cli clang++ --manifest test-vcpkg.json -- .github/workflows/fixtures/test-sqlite.c
./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 All @@ -94,13 +97,6 @@ jobs:
- name: Install pkg-config on Windows
run: choco install pkgconfiglite

# - name: Configure Pagefile
# uses: al-cheb/[email protected]
# with:
# minimum-size: 4GB
# maximum-size: 16GB
# if: runner.os == 'Windows'

- uses: actions/checkout@v3

- uses: actions/setup-java@v3
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
2 changes: 1 addition & 1 deletion modules/cli/src/main/scala/CommandLineApp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ object VcpkgCLI extends VcpkgPluginImpl, VcpkgPluginNativeImpl:
output,
allDeps,
result.filter((k, v) => allDeps.contains(k))
).foreach(println)
).map(_.get).foreach(println)
case Action.InvokeCompiler(compiler, deps, rest) =>
val result = vcpkgInstallImpl(deps, manager, logger)
import io.circe.parser.decode
Expand Down

0 comments on commit 826100b

Please sign in to comment.