From 8d172f0d92ef8d35d85ceee6c4562aed31ac7fd0 Mon Sep 17 00:00:00 2001 From: osmaczko <33099791+osmaczko@users.noreply.github.com> Date: Tue, 24 Feb 2026 12:59:46 +0100 Subject: [PATCH] chore: add nim bindings test ci check --- .github/workflows/ci.yml | 15 +++++++++++++++ nim-bindings/conversations_example.nimble | 8 ++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53bf752..6448e36 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/nim-bindings/conversations_example.nimble b/nim-bindings/conversations_example.nimble index dc48df7..6703227 100644 --- a/nim-bindings/conversations_example.nimble +++ b/nim-bindings/conversations_example.nimble @@ -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"