Skip to content

Commit

Permalink
o
Browse files Browse the repository at this point in the history
  • Loading branch information
bung87 committed Aug 1, 2021
1 parent 44c3eaf commit 6244068
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ jobs:
matrix:
# 10.x, 12.x,
node-version: [ 12.x]
operating-system: [ubuntu-latest, windows-latest, macos-latest,'windows-latest']
operating-system: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v2
with:
submodules: true

- uses: jiro4989/setup-nim-action@v1
with:
nim-version: '1.4.8' # default is
- name: Install nim deps
run: nimble install -d -y
- name: Setup node
Expand All @@ -30,7 +32,7 @@ jobs:
node-version: ${{ matrix.node }}
- name: Install node deps
run: |
yarn global add node-gyp
npm install -g node-gyp
yarn install --ignore-scripts
working-directory: test
- name: test
Expand All @@ -49,4 +51,4 @@ jobs:
working-directory: test
env:
PREBUILD_TOKEN: ${{ secrets.PREBUILD_TOKEN }}
run: yarn prebuild --upload-all -u ${{ secrets.PREBUILD_TOKEN }}
run: yarn prebuild --upload-all ${{ secrets.PREBUILD_TOKEN }}
9 changes: 4 additions & 5 deletions napibindings.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ skipDirs = @["test", ".git"]
bin = @["napibuild"]

requires "docopt"

import os
task test,"test":
withDir "test":
exec "yarn install --ignore-scripts"
exec "nim c -r src/napibuild.nim test/main.nim"
exec "node test/index.js"
exec findExe("yarn") & " install --ignore-scripts --cwd test"
selfExec "c -r " & "src" / "napibuild.nim" & " -r " & "test" / "main.nim"
exec findExe("node") & " " & "test" / "index.js"
7 changes: 4 additions & 3 deletions src/napibuild.nim
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ var


if not args["-C"]:
var releaseFlag = if args["-r"]: "-d:release " else: "--embedsrc "
let r = execCmdEx "nim c --nimcache:" & nimcache & " " & releaseFlag & "--compileOnly --noMain " & projectfile
let releaseFlag = if args["-r"]: "-d:release " else: "--embedsrc "
let vccFlag = when defined(windows): " --cc:vcc " else: ""
let r = execCmdEx "nim c " & vccFlag & " --nimcache:" & nimcache & " " & releaseFlag & "--compileOnly --noMain " & projectfile
doAssert r.exitCode == 0, r.output


Expand All @@ -46,5 +47,5 @@ writeFile(project.dir / "binding.gyp", gyp.pretty)
var gypflags = "--directory=" & project.dir
if not args["-r"]: gypflags.add(" --debug")

let gypRebuild = execCmdEx "node-gyp rebuild " & gypflags
let gypRebuild = execCmdEx findExe("node-gyp") & " rebuild " & gypflags
doAssert gypRebuild.exitCode == 0, gypRebuild.output

0 comments on commit 6244068

Please sign in to comment.