Skip to content

Commit

Permalink
Test node-gyp (WIP, disabled for now)
Browse files Browse the repository at this point in the history
  • Loading branch information
vweevers committed Feb 27, 2022
1 parent 4a5e07e commit 285ff82
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/test.yml
Expand Up @@ -31,12 +31,16 @@ jobs:
tags: |
prebuild/${{ matrix.image }}:dev
push: false
- name: Test
- name: Print versions
run: |
docker run --rm prebuild/${{ matrix.image }}:dev whoami
docker run --rm prebuild/${{ matrix.image }}:dev node -v
docker run --rm prebuild/${{ matrix.image }}:dev npm -v
docker run --rm prebuild/${{ matrix.image }}:dev npx -v
docker run --rm prebuild/${{ matrix.image }}:dev python --version
docker run --rm prebuild/${{ matrix.image }}:dev npm ls node-gyp -g
docker run --rm prebuild/${{ matrix.image }}:dev env
- name: Print env
run: docker run --rm prebuild/${{ matrix.image }}:dev env

# TODO: fix WORKDIR and permissions (#10)
# - name: Test node-gyp
# run: docker run --rm -v $(pwd)/test/native-addon:/home/node/app:z -w /home/node/app prebuild/${{ matrix.image }}:dev npm run install
1 change: 1 addition & 0 deletions test/native-addon/.gitignore
@@ -0,0 +1 @@
build/
1 change: 1 addition & 0 deletions test/native-addon/.npmrc
@@ -0,0 +1 @@
package-lock=false
8 changes: 8 additions & 0 deletions test/native-addon/binding.cc
@@ -0,0 +1,8 @@
#define NAPI_VERSION 3
#include <node_api.h>

napi_value init(napi_env env, napi_value exports) {
return exports;
}

NAPI_MODULE(NODE_GYP_MODULE_NAME, init)
6 changes: 6 additions & 0 deletions test/native-addon/binding.gyp
@@ -0,0 +1,6 @@
{
"targets": [{
"target_name": "native_addon",
"sources": ["binding.cc"]
}]
}
10 changes: 10 additions & 0 deletions test/native-addon/package.json
@@ -0,0 +1,10 @@
{
"name": "native-addon",
"version": "0.0.0",
"description": "Test package",
"private": true,
"license": "MIT",
"scripts": {
"install": "node-gyp rebuild"
}
}

0 comments on commit 285ff82

Please sign in to comment.