From 1d0d886cdcb17b25108c7b904f84819629c0e4fb Mon Sep 17 00:00:00 2001 From: Miran Date: Wed, 26 Jun 2024 07:33:08 +0200 Subject: [PATCH] update ci.yml and be more explicit in .nimble (#174) * update ci.yml and be more explicit in .nimble * test both amd64 and arm64 macos * import results: get rid of the deprecated warning --- .github/workflows/ci.yml | 22 +++++++++++++++------- blscurve.nimble | 7 ++++--- blscurve/blst/blst_recovery.nim | 3 ++- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f9d708..592fba9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,23 +22,29 @@ jobs: cpu: i386 - os: macos cpu: amd64 + - os: macos + cpu: arm64 - os: windows cpu: amd64 - #- os: windows - #cpu: i386 branch: [version-1-6, version-2-0, devel] include: - target: os: linux - builder: ubuntu-20.04 + builder: ubuntu-latest + shell: bash + - target: + os: macos + cpu: amd64 + builder: macos-13 shell: bash - target: os: macos - builder: macos-12 + cpu: arm64 + builder: macos-latest shell: bash - target: os: windows - builder: windows-2019 + builder: windows-latest shell: msys2 {0} defaults: @@ -50,7 +56,7 @@ jobs: continue-on-error: ${{ matrix.branch == 'devel' }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true @@ -98,7 +104,7 @@ jobs: - name: Restore Nim DLLs dependencies (Windows) from cache if: runner.os == 'Windows' id: windows-dlls-cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: external/dlls-${{ matrix.target.cpu }} key: 'dlls-${{ matrix.target.cpu }}' @@ -122,6 +128,8 @@ jobs: run: | if [[ '${{ matrix.target.cpu }}' == 'amd64' ]]; then PLATFORM=x64 + elif [[ '${{ matrix.target.cpu }}' == 'arm64' ]]; then + PLATFORM=arm64 else PLATFORM=x86 fi diff --git a/blscurve.nimble b/blscurve.nimble index a0d683b..ef96db0 100644 --- a/blscurve.nimble +++ b/blscurve.nimble @@ -13,6 +13,7 @@ installFiles = @["blscurve.nim"] requires "nim >= 1.6.0", "nimcrypto", "stew", + "results", "taskpools >= 0.0.5" let nimc = getEnv("NIMC", "nim") # Which nim compiler to use @@ -29,9 +30,9 @@ proc build(args, path: string) = exec nimc & " " & lang & " " & cfg & " " & flags & " " & args & " " & path proc run(args, path: string) = - build args & " -r", path + build args & " --mm:refc -r", path if (NimMajor, NimMinor) > (1, 6): - build args & " --mm:refc -r", path + build args & " --mm:orc -r", path ### tasks task test, "Run all tests": @@ -55,7 +56,7 @@ task test, "Run all tests": when (defined(windows) and sizeof(pointer) == 4): # Eth2 vectors without batch verify - run "-d:BLS_FORCE_BACKEND=blst", "tests/eth2_vectors.nim" + run "--threads:off -d:BLS_FORCE_BACKEND=blst", "tests/eth2_vectors.nim" else: run "--threads:on -d:BLS_FORCE_BACKEND=blst", "tests/eth2_vectors.nim" diff --git a/blscurve/blst/blst_recovery.nim b/blscurve/blst/blst_recovery.nim index 747e7db..4872491 100644 --- a/blscurve/blst/blst_recovery.nim +++ b/blscurve/blst/blst_recovery.nim @@ -1,6 +1,7 @@ import sequtils, - stew/[results, objects], + results, + stew/objects, ./blst_lowlevel, ./blst_min_pubkey_sig_core