Skip to content

Commit

Permalink
Add arm32, arm64 jenkins
Browse files Browse the repository at this point in the history
Signed-off-by: Seonghyun Kim <[email protected]>
  • Loading branch information
ksh8281 committed Aug 28, 2023
1 parent a1fddb5 commit d5a118c
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 57 deletions.
57 changes: 0 additions & 57 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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/[email protected]
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:
Expand Down
91 changes: 91 additions & 0 deletions .jenkins/JenkinsfileArm
Original file line number Diff line number Diff line change
@@ -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()
}
}

0 comments on commit d5a118c

Please sign in to comment.