From cbfc790f9bdfc296cec724e752e5e1f606be8f8b Mon Sep 17 00:00:00 2001 From: tequ Date: Sat, 5 Apr 2025 02:32:47 +0900 Subject: [PATCH] feat: Run unittests in parallel with Github Actions (#483) Implement parallel execution for unit tests using Github Actions to improve CI pipeline efficiency and reduce build times. --- docker-unit-tests.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) mode change 100644 => 100755 docker-unit-tests.sh diff --git a/docker-unit-tests.sh b/docker-unit-tests.sh old mode 100644 new mode 100755 index 6bfde48c0..8406ba86a --- a/docker-unit-tests.sh +++ b/docker-unit-tests.sh @@ -1,4 +1,11 @@ -#!/bin/bash +#!/bin/bash -x + +BUILD_CORES=$(echo "scale=0 ; `nproc` / 1.337" | bc) + +if [[ "$GITHUB_REPOSITORY" == "" ]]; then + #Default + BUILD_CORES=8 +fi echo "Mounting $(pwd)/io in ubuntu and running unit tests" -docker run --rm -i -v $(pwd):/io ubuntu sh -c '/io/release-build/xahaud -u' +docker run --rm -i -v $(pwd):/io -e BUILD_CORES=$BUILD_CORES ubuntu sh -c '/io/release-build/xahaud --unittest-jobs $BUILD_CORES -u'