This includes a basic test that attempts to compile the rustfmt crate. Ensures that the workspace is always removed at the end of the build. It utilizes available caches to speed up the build process and parallelizes the build across i386, x86_64, arm32, and arm64 targets. Signed-off-by: Derek Straka <derek@asterius.io>
37 lines
1006 B
Groovy
37 lines
1006 B
Groovy
def targets = [ 'qemux86', 'qemux86-64', 'qemuarm', 'qemuarm64' ]
|
|
|
|
def machine_builds = [:]
|
|
|
|
for (int i = 0; i < targets.size(); i++) {
|
|
def machine = targets.get(i)
|
|
|
|
machine_builds["$machine"] = {
|
|
node {
|
|
try {
|
|
stage('Checkout') {
|
|
checkout scm
|
|
}
|
|
stage('Setup Environment') {
|
|
sh "./scripts/setup-env.sh"
|
|
}
|
|
stage('Yocto Fetch') {
|
|
sh "GIT_LOCAL_REF_DIR=/srv/git-cache/ ./scripts/fetch.sh master"
|
|
}
|
|
stage('Build') {
|
|
sh "MACHINE=${machine} ./scripts/build.sh"
|
|
}
|
|
} catch (e) {
|
|
echo "Caught: ${e}"
|
|
throw e
|
|
} finally {
|
|
stage('Cleanup Environment') {
|
|
sh "./scripts/cleanup-env.sh"
|
|
deleteDir()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
parallel machine_builds
|