chore: add nim bindings test ci check

This commit is contained in:
osmaczko 2026-02-24 12:59:46 +01:00
parent 5767997e0e
commit 8d172f0d92
No known key found for this signature in database
GPG Key ID: 6A385380FD275B44
2 changed files with 21 additions and 2 deletions

View File

@ -36,3 +36,18 @@ jobs:
- run: rustup update stable && rustup default stable
- run: rustup component add rustfmt
- run: cargo fmt --all -- --check
nim-bindings-test:
name: Nim Bindings Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup update stable && rustup default stable
- name: Install Nim via choosenim
run: |
curl https://nim-lang.org/choosenim/init.sh -sSf | sh -s -- -y
echo "$HOME/.nimble/bin" >> $GITHUB_PATH
- run: nimble install -dy
working-directory: nim-bindings
- run: nimble pingpong
working-directory: nim-bindings

View File

@ -13,9 +13,13 @@ bin = @["libchat"]
requires "nim >= 2.2.4"
requires "results"
# Build Rust library before compiling Nim
before build:
task buildRust, "Build Rust library":
exec "cargo build --release --manifest-path ../Cargo.toml"
# Build Rust library before compiling Nim
before build:
buildRustTask()
task pingpong, "Run pingpong example":
buildRustTask()
exec "nim c -r --path:src --passL:../target/release/liblibchat.a examples/pingpong.nim"