From 462c58d58b9404b3dbf3ac592b6bcc33d54b357a Mon Sep 17 00:00:00 2001 From: Henry Wang Date: Wed, 17 Jun 2020 18:16:19 +0800 Subject: [PATCH] tests: Enable AArch64 Jenkins CI with unit tests for GNU This commit enables the AArch64 Jenkins CI with build and running unit tests for GNU toolchain. Signed-off-by: Henry Wang --- .github/workflows/cross-build.yaml | 2 +- Jenkinsfile | 25 ++++++++++++++++++++++++- scripts/dev_cli.sh | 2 +- scripts/run_unit_tests.sh | 1 + 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cross-build.yaml b/.github/workflows/cross-build.yaml index 48407b82b..38004b87e 100644 --- a/.github/workflows/cross-build.yaml +++ b/.github/workflows/cross-build.yaml @@ -25,7 +25,7 @@ jobs: - name: Install arm64 libfdt run: wget http://ftp.us.debian.org/debian/pool/main/d/device-tree-compiler/libfdt-dev_1.6.0-1_arm64.deb && dpkg-deb -xv libfdt-dev_1.6.0-1_arm64.deb ./tlibfdtdev && sudo mkdir /tmmmp && mkdir target && mkdir target/debug && mkdir target/debug/deps && sudo cp ./tlibfdtdev/usr/lib/aarch64-linux-gnu/libfdt.a target/debug/deps/libfdt.a && echo "libfdt installed" - name: Disable "with-serde" in kvm-bindings - run: sed -i 's/"with-serde",\ //g' vmm/Cargo.toml && sed -i 's/"with-serde",\ //g' hypervisor/Cargo.toml + run: sed -i 's/"with-serde",\ //g' hypervisor/Cargo.toml - name: Build uses: actions-rs/cargo@v1 with: diff --git a/Jenkinsfile b/Jenkinsfile index 697ff26fd..7e0b412d1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -67,6 +67,29 @@ pipeline{ } } } + stage ('AArch64 worker build') { + agent { node { label 'bionic-arm64' } } + options { + timeout(time: 1, unit: 'HOURS') + } + stages { + stage ('Checkout') { + steps { + checkout scm + } + } + stage ('Build') { + steps { + sh "scripts/dev_cli.sh build --release" + } + } + stage ('Run unit tests') { + steps { + sh "scripts/dev_cli.sh tests --unit" + } + } + } + } stage ('Worker build (musl)') { agent { node { label 'bionic' } } options { @@ -108,4 +131,4 @@ def cancelPreviousBuilds() { build.doStop() } } -} \ No newline at end of file +} diff --git a/scripts/dev_cli.sh b/scripts/dev_cli.sh index 77d03f39e..cceac17a2 100755 --- a/scripts/dev_cli.sh +++ b/scripts/dev_cli.sh @@ -210,7 +210,7 @@ cmd_build() { # A workaround on Arm64 to avoid build errors in kvm-bindings if [ $(uname -m) = "aarch64" ]; then - sed -i 's/"with-serde",\ //g' "$CLH_ROOT_DIR"/vmm/Cargo.toml + sed -i 's/"with-serde",\ //g' "$CLH_ROOT_DIR"/hypervisor/Cargo.toml fi $DOCKER_RUNTIME run \ diff --git a/scripts/run_unit_tests.sh b/scripts/run_unit_tests.sh index cf6a360be..af8d5c35e 100755 --- a/scripts/run_unit_tests.sh +++ b/scripts/run_unit_tests.sh @@ -6,6 +6,7 @@ BUILD_TARGET=${BUILD_TARGET-x86_64-unknown-linux-gnu} cargo_args=("$@") [ $(uname -m) = "aarch64" ] && cargo_args+=("--no-default-features") [ $(uname -m) = "aarch64" ] && cargo_args+=("--features mmio") +[ $(uname -m) = "aarch64" ] && sed -i 's/"with-serde",\ //g' hypervisor/Cargo.toml cargo test --target $BUILD_TARGET --workspace --no-run ${cargo_args[@]} pushd target/$BUILD_TARGET/debug