From d5a118c33982049a7eb21f2fe6189ea01aababa9 Mon Sep 17 00:00:00 2001 From: Seonghyun Kim Date: Mon, 28 Aug 2023 13:57:24 +0900 Subject: [PATCH] Add arm32, arm64 jenkins Signed-off-by: Seonghyun Kim --- .github/workflows/actions.yml | 57 ---------------------- .jenkins/JenkinsfileArm | 91 +++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 57 deletions(-) create mode 100644 .jenkins/JenkinsfileArm diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index a2e1531bc..6da0251b2 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -115,63 +115,6 @@ jobs: - name: Run Tests run: $RUNNER --engine="$GITHUB_WORKSPACE/out/linux/x64/walrus" - build-test-on-armv7: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - submodules: true - - name: Build in arm32 container - uses: uraimo/run-on-arch-action@v2.5.0 - with: - arch: armv7 - distro: ubuntu_latest - - # Install deps into the container. With the token, the container will be cached - # The image is cached publically like a package - githubToken: ${{ github.token }} - - install: | - apt-get update - apt-get install -y cmake build-essential ninja-build pkg-config python3 clang-12 - #FIXME fix clang version as to 12 - ln -s /usr/bin/clang-12 /usr/bin/clang - ln -s /usr/bin/clang++-12 /usr/bin/clang++ - run: | - CC=clang CXX=clang++ cmake -H. -Bout/debug -DWALRUS_ARCH=arm -DWALRUS_HOST=linux -DWALRUS_MODE=debug -DWALRUS_OUTPUT=shell -GNinja - ninja -Cout/debug - # remove 2 test files due to stack overflow occurred by recursion calls in debug mode build by clang - rm ./test/wasm-spec/core/call.wast - rm ./test/wasm-spec/core/call_indirect.wast - python3 ./tools/run-tests.py --engine="./out/debug/walrus" - - build-test-on-aarch64: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - submodules: true - - name: Build in arm64 container - uses: uraimo/run-on-arch-action@v2.5.0 - with: - arch: aarch64 - distro: ubuntu_latest - - # Install deps into the container. With the token, the container will be cached - # The image is cached publically like a package - githubToken: ${{ github.token }} - - install: | - apt-get update - apt-get install -y cmake build-essential ninja-build pkg-config python3 clang-12 - #FIXME fix clang version as to 12 - ln -s /usr/bin/clang-12 /usr/bin/clang - ln -s /usr/bin/clang++-12 /usr/bin/clang++ - run: | - CC=clang CXX=clang++ cmake -H. -Bout/release -DWALRUS_ARCH=aarch64 -DWALRUS_HOST=linux -DWALRUS_MODE=release -DWALRUS_OUTPUT=shell -GNinja - ninja -Cout/release - python3 ./tools/run-tests.py --engine="./out/release/walrus" - test-on-windows-x86-x64: runs-on: windows-2022 strategy: diff --git a/.jenkins/JenkinsfileArm b/.jenkins/JenkinsfileArm new file mode 100644 index 000000000..4c4d51c64 --- /dev/null +++ b/.jenkins/JenkinsfileArm @@ -0,0 +1,91 @@ +def isPr() { + env.CHANGE_ID != null +} +node { + currentBuild.displayName = "Walrus test on Arm" + try { + stage("Get source") { + def url = 'https://github.com/Samsung/walrus.git' + if (isPr()) { + def refspec = "+refs/pull/${env.CHANGE_ID}/head:refs/remotes/origin/PR-${env.CHANGE_ID} +refs/heads/master:refs/remotes/origin/master" + def extensions = [[$class: 'PreBuildMerge', options: [mergeRemote: "refs/remotes/origin", mergeTarget: "PR-${env.CHANGE_ID}"]]] + checkout([ + $class: 'GitSCM', + doGenerateSubmoduleConfigurations: false, + extensions: extensions, + submoduleCfg: [], + userRemoteConfigs: [[ + refspec: refspec, + url: url + ]] + ]) + } else { + def refspec = "+refs/heads/master:refs/remotes/origin/master" + def extensions = [] + checkout([ + $class: 'GitSCM', + doGenerateSubmoduleConfigurations: false, + extensions: [[$class: 'WipeWorkspace']], + submoduleCfg: [], + userRemoteConfigs: [[ + refspec: refspec, + url: url + ]] + ]) + } + } + + stage('Submodule update') { + sh 'git submodule update --init' + } + + def arm32RemoteInfo = [:] + arm32RemoteInfo.name = 'arm32-docker' + arm32RemoteInfo.host = 'localhost' + arm32RemoteInfo.port = 11111 + arm32RemoteInfo.allowAnyHosts = true + withCredentials([usernamePassword(credentialsId: 'arm32docker', passwordVariable: 'passwordVariable', usernameVariable: 'usernameVariable')]) { + arm32RemoteInfo.user = usernameVariable + arm32RemoteInfo.password = passwordVariable + } + stage('prepare arm32 workspace') { + sshCommand remote: arm32RemoteInfo, command: "rm -rf walrus walrus.zip" + sshCommand remote: arm32RemoteInfo, command: "pwd" + sh "zip -r walrus.zip ./*" + sshPut remote: arm32RemoteInfo, from: "walrus.zip", into: "./" + sshCommand remote: arm32RemoteInfo, command: "unzip walrus.zip -d walrus" + } + + stage('Build arm32') { + sshCommand remote: arm32RemoteInfo, command: "\ + cd walrus;\ + cmake -H./ -Bout -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=arm32 -GNinja;\ + cmake --build ./out/;\ + " + } + + stage('Build aarch64') { + sh 'cmake -H./ -Bout -GNinja' + sh 'cmake --build ./out/' + } + + stage('Running test') { + timeout(60) { + parallel ( + 'arm32' : { + sshCommand remote: arm32RemoteInfo, command: "\ + cd walrus;\ + tools/run-tests.py --engine='/root/walrus/out/walrus'" + }, + 'aarch64' : { + sh '#!/bin/bash\ntools/run-tests.py --engine="${WORKSPACE}/out/walrus"' + }, + ) + } + } + } catch (e) { + throw e + } finally { + cleanWs() + } +}