Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

re active with current nim version 1.4.6 #4

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: build-test

on:
pull_request:
paths-ignore:
- '**.md'
push:
paths-ignore:
- '**.md'

jobs:
build:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
# 10.x, 12.x,
node-version: [ 12.x]
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
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Install node deps
run: |
npm install -g node-gyp
yarn install --ignore-scripts
working-directory: test
- name: test
run: nimble test

- name: Check if Git tag exists
run: echo "::set-env name=HEAD_TAG::$(git tag --points-at HEAD)"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- name: build
run: yarn build
if: env.HEAD_TAG != ''
working-directory: test
- name: publish
if: env.HEAD_TAG != ''
working-directory: test
env:
PREBUILD_TOKEN: ${{ secrets.PREBUILD_TOKEN }}
run: yarn prebuild --upload-all ${{ secrets.PREBUILD_TOKEN }}
40 changes: 30 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
*~
*.swp
*.swo
bin/napibuild
**/nimcache/
**/build/
**/node_modules/
**/package-lock.json
**/binding.gyp

*
!**/
!*.*
test/build
test/prebuilds
binding.gyp
yarn.lock
node_modules
# Cache
nimcache/
rnimcache/
dnimcache/
nimbledeps/
*.o
!/icons/*.o
*.obj
*.ilk
*.exp
*.pdb
*.lib
*.dll
*.exe
*.so
*.dylib
*.zip
*.iss
*.log
*.pdb
.DS_Store
*.out
26 changes: 2 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# NapiBindings
# NapiBindings [![build-test](https://github.com/bung87/napibindings/actions/workflows/build-test.yml/badge.svg)](https://github.com/bung87/napibindings/actions/workflows/build-test.yml)
Bindings between Nim and N-API

## Getting started
Expand All @@ -20,30 +20,8 @@ Consequently, `node-gyp` requires `python 2.x`, while version `2.7` is recommend


### Installing
To install this library and `napibuild`
```bash
git clone https://github.com/AjBreidenbach/napibindings.git
cd napibindings
nimble install
```

Enter `y` and you're finished

To run all tests
```bash
cd test/
npm install
napibuild main.nim
node index.js
cd ../
```
To view the documentation
```bash
nim doc napibindings.nim && google-chrome napibindings.html > /dev/null &

```


`nimble install https://github.com/bung87/napibindings`

### Creating a new simple project
Start by running `npm init` and entering information as prompted
Expand Down
7 changes: 6 additions & 1 deletion napibindings.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ srcDir = "src"
skipDirs = @["test", ".git"]
bin = @["napibuild"]

requires "https://github.com/docopt/docopt.nim#master"
requires "docopt"
import os
task test,"test":
exec findExe("yarn") & " install --ignore-scripts --cwd test"
selfExec "c -r " & "src" / "napibuild.nim" & " -r " & "test" / "main.nim"
exec findExe("node") & " " & "test" / "index.js"
Loading