parent
c7f1a37d9b
commit
8e1d11c799
|
@ -30,7 +30,7 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
- target:
|
- target:
|
||||||
os: macos
|
os: macos
|
||||||
builder: macos-10.15
|
builder: macos-12
|
||||||
shell: bash
|
shell: bash
|
||||||
- target:
|
- target:
|
||||||
os: windows
|
os: windows
|
||||||
|
@ -43,6 +43,7 @@ jobs:
|
||||||
|
|
||||||
name: '${{ matrix.target.os }}-${{ matrix.target.cpu }} (Nim ${{ matrix.branch }})'
|
name: '${{ matrix.target.os }}-${{ matrix.target.cpu }} (Nim ${{ matrix.branch }})'
|
||||||
runs-on: ${{ matrix.builder }}
|
runs-on: ${{ matrix.builder }}
|
||||||
|
continue-on-error: ${{ matrix.branch == 'devel' }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -95,23 +96,23 @@ jobs:
|
||||||
id: windows-dlls-cache
|
id: windows-dlls-cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: external/dlls
|
path: external/dlls-${{ matrix.target.cpu }}
|
||||||
key: 'dlls'
|
key: 'dlls-${{ matrix.target.cpu }}'
|
||||||
|
|
||||||
- name: Install DLL dependencies (Windows)
|
- name: Install DLLs dependencies (Windows)
|
||||||
if: >
|
if: >
|
||||||
steps.windows-dlls-cache.outputs.cache-hit != 'true' &&
|
steps.windows-dlls-cache.outputs.cache-hit != 'true' &&
|
||||||
runner.os == 'Windows'
|
runner.os == 'Windows'
|
||||||
run: |
|
run: |
|
||||||
mkdir external
|
mkdir -p external
|
||||||
curl -L "https://nim-lang.org/download/windeps.zip" -o external/windeps.zip
|
curl -L "https://nim-lang.org/download/windeps.zip" -o external/windeps.zip
|
||||||
7z x external/windeps.zip -oexternal/dlls
|
7z x -y external/windeps.zip -oexternal/dlls-${{ matrix.target.cpu }}
|
||||||
|
|
||||||
- name: Path to cached dependencies (Windows)
|
- name: Path to cached dependencies (Windows)
|
||||||
if: >
|
if: >
|
||||||
runner.os == 'Windows'
|
runner.os == 'Windows'
|
||||||
run: |
|
run: |
|
||||||
echo '${{ github.workspace }}'"/external/dlls" >> $GITHUB_PATH
|
echo "${{ github.workspace }}/external/dlls-${{ matrix.target.cpu }}" >> $GITHUB_PATH
|
||||||
|
|
||||||
- name: Derive environment variables
|
- name: Derive environment variables
|
||||||
run: |
|
run: |
|
||||||
|
@ -153,5 +154,5 @@ jobs:
|
||||||
nim --version
|
nim --version
|
||||||
nimble --version
|
nimble --version
|
||||||
nimble install -y --depsOnly
|
nimble install -y --depsOnly
|
||||||
env TEST_LANG="c" nimble test
|
env NIMLANG=c nimble test
|
||||||
env TEST_LANG="cpp" nimble test
|
env NIMLANG=cpp nimble test
|
||||||
|
|
|
@ -8,16 +8,28 @@ license = "Apache License 2.0"
|
||||||
skipDirs = @["tests"]
|
skipDirs = @["tests"]
|
||||||
installDirs = @["secp256k1_wrapper"]
|
installDirs = @["secp256k1_wrapper"]
|
||||||
|
|
||||||
requires "nim >= 1.2.0"
|
requires "nim >= 1.2.0",
|
||||||
requires "stew"
|
"stew",
|
||||||
requires "nimcrypto"
|
"nimcrypto"
|
||||||
|
|
||||||
proc test(args, path: string) =
|
let nimc = getEnv("NIMC", "nim") # Which nim compiler to use
|
||||||
# style checking can't generate errors, because nimcrypto mixes styles
|
let lang = getEnv("NIMLANG", "c") # Which backend (c/cpp/js)
|
||||||
exec "nim " & getEnv("TEST_LANG", "c") & " " & getEnv("NIMFLAGS") & " " & args &
|
let flags = getEnv("NIMFLAGS", "") # Extra flags for the compiler
|
||||||
" -r -f --hints:off --styleCheck:usages --styleCheck:hint --skipParentCfg " & path
|
let verbose = getEnv("V", "") notin ["", "0"]
|
||||||
|
|
||||||
|
let styleCheckStyle = if (NimMajor, NimMinor) < (1, 6): "hint" else: "error"
|
||||||
|
let cfg =
|
||||||
|
" --styleCheck:usages --styleCheck:" & styleCheckStyle &
|
||||||
|
(if verbose: "" else: " --verbosity:0 --hints:off") &
|
||||||
|
" --skipParentCfg --skipUserCfg"
|
||||||
|
|
||||||
|
proc build(args, path: string) =
|
||||||
|
exec nimc & " " & lang & " " & cfg & " " & flags & " " & args & " " & path
|
||||||
|
|
||||||
|
proc run(args, path: string) =
|
||||||
|
build args & " -r", path
|
||||||
|
|
||||||
task test, "Tests":
|
task test, "Tests":
|
||||||
test "--threads:on", "tests/all_tests"
|
run "--threads:on", "tests/all_tests"
|
||||||
test "--threads:off", "tests/all_tests"
|
run "--threads:off", "tests/all_tests"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue