Skip to content

Commit

Permalink
Added jenkins pipeline (#7)
Browse files Browse the repository at this point in the history
Run tests with pytest
  • Loading branch information
adeas31 committed Oct 7, 2020
1 parent 1144921 commit e6b317e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 11 deletions.
10 changes: 10 additions & 0 deletions .jenkins/python3/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM docker.openmodelica.org/build-deps:v1.16.2

RUN apt-get update \
&& apt-get install -qy gnupg wget ca-certificates apt-transport-https sudo \
&& echo "deb https://build.openmodelica.org/omc/builds/linux/releases/1.14.2/ `lsb_release -sc` release" > /etc/apt/sources.list.d/openmodelica.list \
&& wget https://build.openmodelica.org/apt/openmodelica.asc -O- | apt-key add - \
&& apt-get update \
&& apt-get install -qy --no-install-recommends omc omlib-modelica-3.2.2 \
&& rm -rf /var/lib/apt/lists/*
RUN pip3 install --no-cache pytest
33 changes: 22 additions & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
pipeline {
agent any
agent none
stages {
stage('') {
agent {
node {
label 'linux'
stage('test') {
parallel {
stage('python3') {
agent {
dockerfile {
// Large image with full OpenModelica build dependencies; lacks omc and OMPython
label 'linux'
dir '.jenkins/python3'
additionalBuildArgs '--pull'
}
}
steps {
sh 'hostname'
sh 'HOME="$PWD" python3 setup.py install --user'
sh '''
export HOME="$PWD"
pytest -v --junit-xml=py3.xml testing
'''
junit 'py3.xml'
}
}

}
steps {
sh 'hostname'
}
}

}
}
}

0 comments on commit e6b317e

Please sign in to comment.