Skip to content

Commit 235ee9b

Browse files
committed
benchmark,tools: fix napi benchmarks on GHA
The GHA benchmark never built the addons of benchmark/napi, and its --debug-node build made benchmark/common.js look for them in build/Debug. Build them when the napi category runs, and pick the build type as test/common does. Refs: #66395 Signed-off-by: Nigro Simone <nigro.simone@gmail.com>
1 parent c6d52f5 commit 235ee9b

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎.github/workflows/benchmark.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ jobs:
140140
--arg withPerfetto ${{ matrix.perfetto || false }} \
141141
--arg ccache '(import <nixpkgs> {}).sccache' \
142142
--run '
143-
make build-ci -j4 V=1
143+
make build-ci -j4 V=1 ${{ contains(format(' {0} ', inputs.category), ' napi ') && '&& make bench-addons-build' || '' }}
144144
' tools/nix/ci-shell.nix
145145
env:
146146
SCCACHE_LOCAL_RW_MODE: READ_ONLY

‎benchmark/common.js‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,11 @@ module.exports = {
470470
return process.binding(bindingName);
471471
}
472472
},
473-
buildType: process.features.debug ? 'Debug' : 'Release',
473+
// As in test/common: a --debug-node build is still a Release build, and its
474+
// addons are in build/Release.
475+
buildType: process.config.target_defaults ?
476+
process.config.target_defaults.default_configuration :
477+
'Release',
474478
createBenchmark(fn, configs, options) {
475479
return new Benchmark(fn, configs, options);
476480
},

0 commit comments

Comments
 (0)