mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-03 15:14:35 +00:00
Build the node package only once in debug
In the ci and on workstations the steps are the same: 1. Install (without building, which would build release) 2. Build debug 3. Run tests Previously only on Windows the tests were run in debug, because the "npm install" step in the nodejs test driver would overwrite a previously created debug build. On windows they are separate DLLs, and thus co-exist. With this patch we always build debug.
This commit is contained in:
parent
c51fb14a0e
commit
2cf8a5b0eb
2 changed files with 17 additions and 5 deletions
8
.github/workflows/ci.yaml
vendored
8
.github/workflows/ci.yaml
vendored
|
@ -128,13 +128,13 @@ jobs:
|
||||||
key: x-napi-v2-${{ steps.node-install.outputs.node-version }} # the cache key consists of a manually bumpable version and the node version, as the cached rustc artifacts contain linking information where to find node.lib, which is in a versioned directory.
|
key: x-napi-v2-${{ steps.node-install.outputs.node-version }} # the cache key consists of a manually bumpable version and the node version, as the cached rustc artifacts contain linking information where to find node.lib, which is in a versioned directory.
|
||||||
- name: Run npm install
|
- name: Run npm install
|
||||||
working-directory: ./api/node
|
working-directory: ./api/node
|
||||||
run: npm install
|
run: npm install --ignore-scripts
|
||||||
- name: Typescript check
|
|
||||||
working-directory: ./api/node
|
|
||||||
run: npm run syntax_check
|
|
||||||
- name: Build node plugin in debug
|
- name: Build node plugin in debug
|
||||||
run: npm run build:debug
|
run: npm run build:debug
|
||||||
working-directory: ./api/node
|
working-directory: ./api/node
|
||||||
|
- name: Typescript check
|
||||||
|
working-directory: ./api/node
|
||||||
|
run: npm run syntax_check
|
||||||
- name: Run node tests
|
- name: Run node tests
|
||||||
working-directory: ./api/node
|
working-directory: ./api/node
|
||||||
run: npm test
|
run: npm test
|
||||||
|
|
|
@ -12,16 +12,28 @@ lazy_static::lazy_static! {
|
||||||
// it tries to emulate CreateProcess.
|
// it tries to emulate CreateProcess.
|
||||||
let npm = which::which("npm").unwrap();
|
let npm = which::which("npm").unwrap();
|
||||||
|
|
||||||
// builds and installs the slint node package
|
// installs the slint node package dependencies
|
||||||
std::process::Command::new(npm.clone())
|
std::process::Command::new(npm.clone())
|
||||||
.arg("install")
|
.arg("install")
|
||||||
.arg("--no-audit")
|
.arg("--no-audit")
|
||||||
|
.arg("--ignore-scripts")
|
||||||
.current_dir(node_dir.clone())
|
.current_dir(node_dir.clone())
|
||||||
.stdout(std::process::Stdio::piped())
|
.stdout(std::process::Stdio::piped())
|
||||||
.stderr(std::process::Stdio::piped())
|
.stderr(std::process::Stdio::piped())
|
||||||
.output()
|
.output()
|
||||||
.map_err(|err| format!("Could not launch npm install: {}", err)).unwrap();
|
.map_err(|err| format!("Could not launch npm install: {}", err)).unwrap();
|
||||||
|
|
||||||
|
// builds the slint node package in debug
|
||||||
|
std::process::Command::new(npm.clone())
|
||||||
|
.arg("run")
|
||||||
|
.arg("build:debug")
|
||||||
|
.current_dir(node_dir.clone())
|
||||||
|
.stdout(std::process::Stdio::piped())
|
||||||
|
.stderr(std::process::Stdio::piped())
|
||||||
|
.output()
|
||||||
|
.map_err(|err| format!("Could not launch npm install: {}", err)).unwrap();
|
||||||
|
|
||||||
|
|
||||||
node_dir.join("index.js")
|
node_dir.join("index.js")
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue