fix: max 3 cores for docker build env

This commit is contained in:
Binarybaron 2025-06-24 00:17:31 +02:00
parent 26f8147812
commit b4118eb49e
2 changed files with 8 additions and 3 deletions

View file

@ -50,6 +50,9 @@ RUN if [ ! -f "monero-sys/monero/CMakeLists.txt" ]; then \
WORKDIR /build/swap
# Act as if we are in a GitHub Actions environment
ENV DOCKER_BUILD=true
RUN cargo build -vv --bin=asb
FROM ubuntu:24.04

View file

@ -2,6 +2,7 @@ use cmake::Config;
fn main() {
let is_github_actions: bool = std::env::var("GITHUB_ACTIONS").is_ok();
let is_docker_build: bool = std::env::var("DOCKER_BUILD").is_ok();
// Only rerun this when the bridge.rs or static_bridge.h file changes.
println!("cargo:rerun-if-changed=src/bridge.rs");
@ -37,9 +38,10 @@ fn main() {
.define("GTEST_HAS_ABSL", "OFF")
// Use lightweight crypto library
.define("MONERO_WALLET_CRYPTO_LIBRARY", "cn")
.build_arg(match is_github_actions {
true => "-j1",
false => "-j",
.build_arg(match (is_github_actions, is_docker_build) {
(true, _) => "-j1",
(_, true) => "-j1",
(_, _) => "-j",
})
.build();