Skip to content

Commit

Permalink
Fix windows i686
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Nov 26, 2020
1 parent fded8fe commit bb3ea94
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 46 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,10 @@ jobs:
name: bindings-linux-aarch64
path: ${{ env.APP_NAME }}.*.node

build-win32-ia686:
build-win32-i686:
runs-on: windows-latest
env:
CARGO_PROFILE_RELEASE_OPT_LEVEL: 0
steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -243,9 +245,7 @@ jobs:
run: yarn build --target i686-pc-windows-msvc

- name: Test binary
run: |
node -v
node simple-test.js
run: yarn test

- name: Upload artifact
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -385,7 +385,7 @@ jobs:
- test
- test-musl
- test-aarch64
- build-win32-ia686
- build-win32-i686
runs-on: ubuntu-latest
steps:
- name: auto-merge
Expand All @@ -401,7 +401,7 @@ jobs:
- test
- test-musl
- test-aarch64
- build-win32-ia686
- build-win32-i686

steps:
- uses: actions/checkout@v2
Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ version = "0.1.0"
crate-type = ["cdylib"]

[dependencies]
napi = {git = "https://github.com/napi-rs/napi-rs", branch = "rust-codegen-win32"}
napi-derive = {git = "https://github.com/napi-rs/napi-rs", branch = "rust-codegen-win32"}
napi = {git = "https://github.com/napi-rs/napi-rs"}
napi-derive = {git = "https://github.com/napi-rs/napi-rs"}

[target.'cfg(all(unix, not(target_env = "musl")))'.dependencies]
jemallocator = {version = "0.3", features = ["disable_initial_exec_tls"]}
Expand All @@ -20,7 +20,7 @@ jemallocator = {version = "0.3", features = ["disable_initial_exec_tls"]}
mimalloc = {version = "0.1"}

[build-dependencies]
napi-build = {git = "https://github.com/napi-rs/napi-rs", branch = "rust-codegen-win32"}
napi-build = {git = "https://github.com/napi-rs/napi-rs"}

[profile.release]
opt-level = 's'
lto = true
41 changes: 9 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,8 @@
"main": "index.js",
"repository": "git@github.com:napi-rs/package-template.git",
"license": "MIT",
"keywords": [
"napi-rs",
"NAPI",
"N-API",
"Rust",
"node-addon",
"node-addon-api"
],
"files": [
"index.d.ts",
"index.js"
],
"keywords": ["napi-rs", "NAPI", "N-API", "Rust", "node-addon", "node-addon-api"],
"files": ["index.d.ts", "index.js"],
"napi": {
"name": "package-template",
"triples": {
Expand Down Expand Up @@ -75,27 +65,14 @@
"@node-rs/helper": "^1.0.0-alpha.1"
},
"lint-staged": {
"*.@(js|ts|tsx)": [
"prettier --write",
"eslint -c .eslintrc.yml --fix"
],
"*.@(yml|yaml)": [
"prettier --parser yaml --write"
],
"*.md": [
"prettier --parser markdown --write"
],
"*.json": [
"prettier --parser json --write"
]
"*.@(js|ts|tsx)": ["prettier --write", "eslint -c .eslintrc.yml --fix"],
"*.@(yml|yaml)": ["prettier --parser yaml --write"],
"*.md": ["prettier --parser markdown --write"],
"*.json": ["prettier --parser json --write"]
},
"ava": {
"require": [
"ts-node/register/transpile-only"
],
"extensions": [
"ts"
],
"require": ["ts-node/register/transpile-only"],
"extensions": ["ts"],
"environmentVariables": {
"TS_NODE_PROJECT": "./tsconfig.json"
}
Expand All @@ -113,4 +90,4 @@
"pre-commit": "lint-staged"
}
}
}
}
6 changes: 2 additions & 4 deletions simple-test.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
const { exec } = require('child_process')
const { stderr } = require('process')

exec(`node -e "console.log(require('./index.js'))"`, (err, stdout, stderr) => {
console.info(stdout)
console.info(stderr)
if (err) {
console.error(err)
process.exit(1)
}
console.info(stdout)
console.info(stderr)
})

0 comments on commit bb3ea94

Please sign in to comment.