diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1fd1fa6..f3f6b04 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,28 +3,39 @@ name: CI on: [push, pull_request] jobs: - test: - runs-on: ubuntu-latest + build: + runs-on: ${{ matrix.os }} + continue-on-error: true strategy: matrix: - nim: [1.6.18, 1.4.8, 1.2.18] - toolchain: - - stable - # - beta - # - nightly + nim: + - '1.6.18' + - '1.6.14' + os: + - ubuntu-latest + - windows-latest + - macOS-latest + name: Build nim circom compat ${{ matrix.nim }} on ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - with: - submodules: 'true' + - uses: actions/checkout@v4 + with: + submodules: 'true' - - name: Install Nim - uses: asdf-vm/actions/install@v3 - with: - tool_versions: | - nim ${{ matrix.nim }} + - name: Set rust ${{ matrix.os }} + if: matrix.os == 'windows-latest' + run: | + rustup set default-host x86_64-pc-windows-gnu + rustup update stable && rustup default stable - - name: Build - run: nimble install -y - - name: Test - run: nimble test -y + - name: Set rust ${{ matrix.os }} + if: matrix.os != 'windows-latest' + run: rustup update stable && rustup default stable + + - name: Setup nim + uses: jiro4989/setup-nim-action@v1 + with: + nim-version: ${{ matrix.nim }} + repo-token: ${{ secrets.GITHUB_TOKEN }} + - run: nimble install -y + - run: nimble test -y diff --git a/circomcompat.nim b/circomcompat.nim index da32bf1..36fb095 100644 --- a/circomcompat.nim +++ b/circomcompat.nim @@ -10,14 +10,21 @@ const libPath* = libDir/"libcircom_compat_ffi.a" static: - let cmd = "cd vendor/circom-compat-ffi && cargo build --release" - warning "\nBuilding circom compat ffi: " & cmd - let (output, exitCode) = gorgeEx cmd - for ln in output.splitLines(): - warning("cargo> " & ln) - if exitCode != 0: - raiseAssert("Failed to build circom-compat-ffi") + let + cmd = "cargo build --release --manifest-path=vendor/circom-compat-ffi/Cargo.toml" -{.passl: "-lcircom_compat_ffi -lm" & " -L" & libDir.} + warning "\nBuilding circom compat ffi: " + warning cmd + let (output, exitCode) = gorgeEx cmd + if exitCode != 0: + for ln in output.splitLines(): + warning("rust error> " & ln) + raiseAssert("Failed to build circom-compat-ffi") + warning "circom compat ffi built successfully\n" + +when defined(windows): + {.passl: "-lcircom_compat_ffi -lm -lws2_32 -luserenv -lntdll -lbcrypt " & " -L" & libDir.} +else: + {.passl: "-lcircom_compat_ffi -lm" & " -L" & libDir.} include circomcompatffi diff --git a/vendor/circom-compat-ffi b/vendor/circom-compat-ffi index b1755a2..190adb8 160000 --- a/vendor/circom-compat-ffi +++ b/vendor/circom-compat-ffi @@ -1 +1 @@ -Subproject commit b1755a2b2e8d3978925cb5815c1564f62756b29d +Subproject commit 190adb8c2362c3189a37858e6070ff8fed538e8b