Karl Palsson
4 years ago
1 changed files with 71 additions and 0 deletions
@ -0,0 +1,71 @@ |
|||
|
|||
pipeline { |
|||
agent {label 'locm3-usb'} |
|||
parameters { |
|||
string(name:'pr_from_git_url', description:'the git url we are going to clone the pr from') |
|||
string(name:'pr_from_sha', description:'what we are going to build') |
|||
} |
|||
|
|||
stages { |
|||
# TODO - set build status to pneding.... |
|||
stage('checkout') { |
|||
steps { |
|||
step([$class: 'GitHubSetCommitStatusBuilder']) |
|||
checkout([$class: 'GitSCM', branches: [[name: $pr_from_sha]], userRemoteConfigs: [[url: $pr_from_git_url]]]) |
|||
} |
|||
} |
|||
stage('build') { |
|||
steps { |
|||
sh 'make -j5 V=s' |
|||
sh 'make -C tests/gadget-zero all V=s' |
|||
} |
|||
} |
|||
stage('Testprepare') { |
|||
steps { |
|||
sh label: 'preparing ', script: ''' |
|||
[ -f .env3 ] || python3 -m venv .env3 |
|||
. .env/bin/activate |
|||
pip install pyusb |
|||
pip install unittest-xml-reporting |
|||
''' |
|||
sh label: 'gadget0', script: ''' |
|||
cd tests/gadget-zero |
|||
echo "hla_serial 53FF6E066765505136472567" > openocd.stm32f3-disco.local.cfg |
|||
echo "hla_serial 57FF6B064967485630481087" > openocd.stm32f4disco.local.cfg |
|||
''' |
|||
} |
|||
} |
|||
stage('flashin') { |
|||
steps { |
|||
dir('tests/gadget-zero') { |
|||
sh ''' |
|||
make -f Makefile.stm32f3-disco flash V=1 |
|||
make -f Makefile.stm32f4disco flash V=1 |
|||
''' |
|||
} |
|||
} |
|||
} |
|||
stage('run-test') { |
|||
steps { |
|||
sh ''' |
|||
. .env/bin/activate |
|||
cd tests/gadget-zero |
|||
python test_gadget0.py -X |
|||
for x in tests/*; do TT=$(basename $x); sed -i "s/testcase classname=\"/testcase classname=\"${TT}./g" $x/TEST-*; done |
|||
''' |
|||
} |
|||
} |
|||
} |
|||
post { |
|||
always { |
|||
junit 'tests/gadget-zero/tests/*/TEST-*.xml' |
|||
step([ |
|||
$class: "GitHubCommitStatusSetter", |
|||
commitShaSource: [$class: "ManuallyEnteredRepositorySource", url: "https://github.com/karlp/libopencm3"], |
|||
reposSource: [$class: "ManuallyEnteredRepositorySource", url: "https://github.com/karlp/libopencm3"], |
|||
contextSource: [$class: "DefaultCommitContextSource"], |
|||
statusResultSource: [ $class: "DefaultStatusResultSource"] |
|||
]); |
|||
} |
|||
} |
|||
} |
Loading…
Reference in new issue