Files
Firmwares/Jenkinsfile

127 lines
3.9 KiB
Groovy

void checkout_project() {
checkout([
$class: 'GitSCM',
branches: [
[name: '*/develop']
],
extensions: [
[$class: 'CleanBeforeCheckout'],
[$class: 'SubmoduleOption', disableSubmodules: false, parentCredentials: true, recursiveSubmodules: true, reference: '', trackingSubmodules: false]
],
submoduleCfg: [],
userRemoteConfigs: [
[credentialsId: 'gitea-jenkins', url: 'https://git.minres.com/Firmware/Firmwares.git']
]
])
}
void checkout_develop() {
dir("bare-metal-bsp") {
withCredentials([usernamePassword(credentialsId: 'gitea-jenkins', usernameVariable: 'GIT_USERNAME', passwordVariable: 'GIT_PASSWORD')]) {
sh ("git pull origin develop")
}
}
//sh("cd bare-metal-bsp && git checkout develop")
}
void make_hello(board) {
sh("make -C hello-world/ BOARD=${board}")
sh("make -C hello-world/ clean")
}
void cmake_hello(board,build_type,core_type) {
sh("cd hello-world/")
def flavor ="${board}_${build_type}_${core_type}"
if (core_type=="32")
flavor ="${board}_${build_type}"
sh("cmake -B ${flavor} --preset=${flavor}")
sh("cmake --build ${flavor}")
}
pipeline {
agent { docker {
image 'ubuntu-riscv'
args '-v $HOME/.m2:/root/.m2'
}}
options {
// using the Timestamper plugin we can add timestamps to the console log
timestamps()
skipStagesAfterUnstable()
}
stages {
/*stage('checkout repo') { steps{ checkout_project()}}
stage('checkout develop') { steps{ checkout_develop()}}
stage('make iss') {steps { make_hello("iss")}}
stage('make hifive1') {steps { make_hello("hifive1")}}
stage('make TGC5L') {steps { make_hello("TGC5L")}}
stage('make rtl') {steps { make_hello("rtl")}}
stage('make ehrenberg') {steps { make_hello("ehrenberg")}}
stage('make tgc_vp') {steps { make_hello("tgc_vp")}}*/
/*
stage('make hello-world') {
matrix {
axes {
axis{
name 'BOARD'
values 'iss', 'hifive1', 'TGCP', 'ehrenberg', 'rtl', 'tgc_vp'
}
}
stages {
stage('Force sequential') {
options {
lock("One Board at a time")
}
stages {
stage("make") {
steps {
make_hello("${BOARD}")
}
}
}
}
}
}
}
*/
stage('CMAKE flow for hello-world') {
matrix {
axes {
axis{
name 'BOARD'
values 'ISS', 'Moonlight', 'TGC_VP'
}
axis{
name 'BUILD_TYPE'
values 'Debug', 'Release'
}
axis{
name 'CORE_TYPE'
values '32', '64'
}
}
stages {
stage('Force sequential') {
options {
lock("One Board at a time")
}
stages {
stage("CMAKE") {
steps {
cmake_hello("${BOARD}","${BUILD_TYPE}","${CORE_TYPE}")
}
}
}
}
}
}
}
}
/*
post {
failure {
sh("make -C hello-world/ clean")
}
}
*/
}