Skip to content
Merged
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
56 changes: 51 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,13 @@ jobs:
npx lerna exec "yarn build --target i686-pc-windows-msvc" --concurrency 1 --stream --no-prefix
yarn test
target: 'i686-pc-windows-msvc'
- host: ubuntu-latest
- host: macos-latest
architecture: x64
target: 'x86_64-unknown-linux-gnu'
docker: |
docker pull $DOCKER_REGISTRY_URL/napi-rs/napi-rs/nodejs-rust:lts-debian
docker tag $DOCKER_REGISTRY_URL/napi-rs/napi-rs/nodejs-rust:lts-debian builder
setup: |
yarn global add lerna --registry https://registry.npmjs.org --network-timeout 300000
build: |
docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/build -w /build builder yarn build
lerna exec "yarn build --target x86_64-unknown-linux-gnu --zig --zig-abi-suffix 2.17 --strip" --concurrency 1 --stream --no-prefix
- host: ubuntu-latest
architecture: x64
target: 'x86_64-unknown-linux-musl'
Expand Down Expand Up @@ -127,6 +126,12 @@ jobs:
override: true
target: ${{ matrix.settings.target }}

- name: Install Zig toolchain
uses: goto-bus-stop/setup-zig@v1
if: matrix.settings.target == 'x86_64-unknown-linux-gnu'
with:
version: 0.9.0

- name: Generate Cargo.lock
uses: actions-rs/cargo@v1
with:
Expand Down Expand Up @@ -323,6 +328,46 @@ jobs:
npx lerna link
yarn test

test-linux-x64-centos-7:
name: Test bindings on Linux-x64-glibc-2.17
needs:
- build
runs-on: ubuntu-latest
container:
image: centos:7
steps:
- uses: actions/checkout@v2

- name: Install dependencies
run: |
curl -sL https://rpm.nodesource.com/setup_16.x | bash -
yum install nodejs -y
npm install -g yarn
yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
yarn add ts-node -D -W

- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: bindings-x86_64-unknown-linux-gnu
path: artifacts

- name: Move artifacts
run: yarn artifacts
shell: bash

- name: List packages
run: ls -R packages
shell: bash

- name: Build TypeScript
run: yarn build:ts

- name: Test bindings
run: |
npx lerna link
yarn test

test-linux-x64-musl-binding:
name: Test bindings on x86_64-unknown-linux-musl - node@${{ matrix.node }}
needs:
Expand Down Expand Up @@ -504,6 +549,7 @@ jobs:
needs:
- build-freebsd
- test-linux-x64-gnu-binding
- test-linux-x64-centos-7
- test-linux-x64-musl-binding
- test-linux-aarch64-gnu-binding
- test-linux-arm-gnueabihf-binding
Expand Down
18 changes: 18 additions & 0 deletions ava.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const USE_TS_NODE = (function () {
try {
require('@swc-node/core')
return false
} catch (e) {
return true
}
})()

module.exports = {
extensions: ['ts'],
workerThreads: false,
require: [USE_TS_NODE ? 'ts-node/register/transpile-only' : '@swc-node/register'],
files: ['packages/**/*.spec.ts'],
environmentVariables: {
TS_NODE_PROJECT: './tsconfig.test.json',
},
}
19 changes: 3 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"postinstall": "husky install"
},
"devDependencies": {
"@napi-rs/cli": "^2.3.0",
"@napi-rs/cli": "^2.4.0",
"@swc-node/core": "^1.8.2",
"@swc-node/register": "^1.4.2",
"@types/node": "^17.0.8",
"@typescript-eslint/eslint-plugin": "^5.9.0",
Expand All @@ -41,24 +42,10 @@
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"prettier": "^2.5.1",
"ts-node": "^10.4.0",
"tslib": "^2.3.1",
"typescript": "^4.5.4"
},
"ava": {
"extensions": [
"ts"
],
"workerThreads": false,
"require": [
"@swc-node/register"
],
"files": [
"packages/**/*.spec.ts"
],
"environmentVariables": {
"TS_NODE_PROJECT": "./tsconfig.test.json"
}
},
"lint-staged": {
"*.@(js|ts|tsx)": [
"eslint -c .eslintrc.yml --fix"
Expand Down
98 changes: 81 additions & 17 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,18 @@
"@babel/helper-validator-identifier" "^7.15.7"
to-fast-properties "^2.0.0"

"@cspotcode/source-map-consumer@0.8.0":
version "0.8.0"
resolved "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz#33bf4b7b39c178821606f669bbc447a6a629786b"
integrity sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==

"@cspotcode/source-map-support@0.7.0":
version "0.7.0"
resolved "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz#4789840aa859e46d2f3173727ab707c66bf344f5"
integrity sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==
dependencies:
"@cspotcode/source-map-consumer" "0.8.0"

"@eslint/eslintrc@^1.0.5":
version "1.0.5"
resolved "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz#33f1b838dbf1f923bfa517e008362b78ddbbf318"
Expand Down Expand Up @@ -926,10 +938,10 @@
semver "^7.3.5"
tar "^6.1.11"

"@napi-rs/cli@^2.3.0":
version "2.3.0"
resolved "https://registry.yarnpkg.com/@napi-rs/cli/-/cli-2.3.0.tgz#fb3c9179bf2ff1088f19b235108208acaf051b6f"
integrity sha512-sDhyEuUVmgQvm37teoHgJP07+XJy57jfbnDBFVrgOw/+vbr/6yhcn68R3oYxxNLkp3+d57ChVyHxglEFJ6j4Hg==
"@napi-rs/cli@^2.4.0":
version "2.4.0"
resolved "https://registry.npmjs.org/@napi-rs/cli/-/cli-2.4.0.tgz#a74d991e12871d6fb8eb32b33cc53a9c105b1921"
integrity sha512-rq4ivqWY7KWG104gRxTmWyehE4eUxJ/mBJx81r3PeghtLZ11NpJNuvF9kSvsol8hTjJQ7CWlF2plQ20I9rMOng==

"@napi-rs/triples@^1.1.0":
version "1.1.0"
Expand Down Expand Up @@ -1245,6 +1257,26 @@
resolved "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82"
integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==

"@tsconfig/node10@^1.0.7":
version "1.0.8"
resolved "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9"
integrity sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==

"@tsconfig/node12@^1.0.7":
version "1.0.9"
resolved "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz#62c1f6dee2ebd9aead80dc3afa56810e58e1a04c"
integrity sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==

"@tsconfig/node14@^1.0.0":
version "1.0.1"
resolved "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz#95f2d167ffb9b8d2068b0b235302fafd4df711f2"
integrity sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==

"@tsconfig/node16@^1.0.2":
version "1.0.2"
resolved "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz#423c77877d0569db20e1fc80885ac4118314010e"
integrity sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==

"@types/bcrypt@^5.0.0":
version "5.0.0"
resolved "https://registry.npmjs.org/@types/bcrypt/-/bcrypt-5.0.0.tgz#a835afa2882d165aff5690893db314eaa98b9f20"
Expand Down Expand Up @@ -1565,7 +1597,7 @@ acorn-jsx@^5.3.1:
resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937"
integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==

acorn-walk@^8.2.0:
acorn-walk@^8.1.1, acorn-walk@^8.2.0:
version "8.2.0"
resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1"
integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==
Expand Down Expand Up @@ -1719,6 +1751,11 @@ are-we-there-yet@~1.1.2:
delegates "^1.0.0"
readable-stream "^2.0.6"

arg@^4.1.0:
version "4.1.3"
resolved "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089"
integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==

argon2@^0.28.3:
version "0.28.3"
resolved "https://registry.npmjs.org/argon2/-/argon2-0.28.3.tgz#e5234eccf20a643ffc3b1bbd1aa9e81092e0d8e9"
Expand Down Expand Up @@ -2531,6 +2568,11 @@ crc@^4.1.0:
resolved "https://registry.yarnpkg.com/crc/-/crc-4.1.0.tgz#bb875159ac3012d52611f13a2bcf5d46b401c8e7"
integrity sha512-xl6/PgOWZCDOA9mnytKzg2ftRS2YT/SUnNPPiCMoD6KWuiJayRjHcaLmBzGWNZGHSXDSrDuLNUEIljLRMbn7vA==

create-require@^1.1.0:
version "1.1.1"
resolved "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333"
integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==

cross-env@^7.0.3:
version "7.0.3"
resolved "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf"
Expand Down Expand Up @@ -2726,6 +2768,11 @@ dezalgo@^1.0.0:
asap "^2.0.0"
wrappy "1"

diff@^4.0.1:
version "4.0.2"
resolved "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==

dir-glob@^3.0.1:
version "3.0.1"
resolved "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f"
Expand Down Expand Up @@ -3134,18 +3181,7 @@ fast-diff@^1.1.2, fast-diff@^1.2.0:
resolved "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03"
integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==

fast-glob@^3.1.1:
version "3.2.7"
resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1"
integrity sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==
dependencies:
"@nodelib/fs.stat" "^2.0.2"
"@nodelib/fs.walk" "^1.2.3"
glob-parent "^5.1.2"
merge2 "^1.3.0"
micromatch "^4.0.4"

fast-glob@^3.2.7:
fast-glob@^3.1.1, fast-glob@^3.2.7:
version "3.2.10"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.10.tgz#2734f83baa7f43b7fd41e13bc34438f4ffe284ee"
integrity sha512-s9nFhFnvR63wls6/kM88kQqDhMu0AfdjqouE2l5GVQPbqLgyFjjU5ry/r2yKsJxpb9Py1EYNqieFrmMaX4v++A==
Expand Down Expand Up @@ -4474,6 +4510,11 @@ make-dir@^3.0.0, make-dir@^3.0.2, make-dir@^3.1.0:
dependencies:
semver "^6.0.0"

make-error@^1.1.1:
version "1.3.6"
resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==

make-fetch-happen@^8.0.9:
version "8.0.14"
resolved "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-8.0.14.tgz#aaba73ae0ab5586ad8eaa68bd83332669393e222"
Expand Down Expand Up @@ -6607,6 +6648,24 @@ trim-newlines@^3.0.0:
resolved "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144"
integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==

ts-node@^10.4.0:
version "10.4.0"
resolved "https://registry.npmjs.org/ts-node/-/ts-node-10.4.0.tgz#680f88945885f4e6cf450e7f0d6223dd404895f7"
integrity sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==
dependencies:
"@cspotcode/source-map-support" "0.7.0"
"@tsconfig/node10" "^1.0.7"
"@tsconfig/node12" "^1.0.7"
"@tsconfig/node14" "^1.0.0"
"@tsconfig/node16" "^1.0.2"
acorn "^8.4.1"
acorn-walk "^8.1.1"
arg "^4.1.0"
create-require "^1.1.0"
diff "^4.0.1"
make-error "^1.1.1"
yn "3.1.1"

tsconfig-paths@^3.12.0:
version "3.12.0"
resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz#19769aca6ee8f6a1a341e38c8fa45dd9fb18899b"
Expand Down Expand Up @@ -7148,6 +7207,11 @@ yargs@^17.3.1:
y18n "^5.0.5"
yargs-parser "^21.0.0"

yn@3.1.1:
version "3.1.1"
resolved "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"
integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==

yocto-queue@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251"
Expand Down