Skip to content
This repository was archived by the owner on Nov 5, 2024. It is now read-only.

Commit 914aa6e

Browse files
committed
set custom NPM_CONFIG_PREFIX on ci
1 parent e5adc3d commit 914aa6e

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

.github/workflows/test.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ jobs:
1818
node: [ '10', '12', '14' ]
1919

2020
steps:
21+
- name: set NPM_CONFIG_PREFIX
22+
run: |
23+
echo "NPM_CONFIG_PREFIX=$HOME/.npm-global" >> $GITHUB_ENV
24+
2125
- name: checkout
2226
uses: actions/checkout@v2
2327
with:
@@ -35,11 +39,19 @@ jobs:
3539
with:
3640
node-version: ${{ matrix.node }}
3741

42+
- name: configure NPM_CONFIG_PREFIX
43+
run: |
44+
npm config set prefix $NPM_CONFIG_PREFIX
45+
echo "$NPM_CONFIG_PREFIX/bin" >> $GITHUB_PATH
46+
3847
- name: install node-gyp
39-
run: sudo npm install -g node-gyp
48+
run: |
49+
npm install -g node-gyp
50+
echo $PATH
51+
which node-gyp
4052
4153
- name: npm install
4254
run: npm install
4355

4456
- name: Run tests
45-
run: make test-all
57+
run: make test-debug

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,17 @@ build-release: build-deps configure
1515
configure:
1616
node-gyp configure
1717

18-
build-deps: build-convert build-cpp-bindings-shared
18+
build-deps: run-build-convert build-cpp-bindings-shared
1919

20-
build-convert:
21-
cd build-convert && cargo run
20+
run-build-convert:
21+
cd build-convert && cargo build
2222

2323
build-cpp-bindings-shared:
2424
cd lib-ruby-parser-cpp-bindings && make cargo-build-release
2525

2626
clean:
27-
node-gyp clean
27+
rm -rf build
28+
rm -rf node_modules
29+
rm -f convert_gen.h
30+
rm -rf lib-ruby-parser-cpp-bindings/target
31+
cd build-convert && cargo clean

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@
55
"dependencies": {
66
"node-addon-api": "^1.5.0"
77
},
8-
"gypfile": true
8+
"scripts": {
9+
"preinstall": "make build-deps"
10+
}
911
}

0 commit comments

Comments
 (0)