Skip to content

Commit

Permalink
Merge pull request #114 from UIUCLibrary/dev
Browse files Browse the repository at this point in the history
ci: tox stages doesn't stall if no agents have the required labels
  • Loading branch information
henryborchers authored Oct 15, 2024
2 parents 6370b8d + 3ead2d2 commit b4deb93
Showing 1 changed file with 37 additions and 31 deletions.
68 changes: 37 additions & 31 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -355,38 +355,44 @@ pipeline {
options {
lock(env.JOB_URL)
}
steps {
script{
def windowsJobs
def linuxJobs
stage('Scanning Tox Environments'){
parallel(
'Linux':{
linuxJobs = getToxTestsParallel(
envNamePrefix: 'Tox Linux',
label: 'linux && docker',
dockerfile: 'ci/docker/python/linux/tox/Dockerfile',
dockerArgs: '--build-arg PIP_EXTRA_INDEX_URL --build-arg PIP_INDEX_URL --build-arg PIP_DOWNLOAD_CACHE=/.cache/pip --build-arg UV_CACHE_DIR=/.cache/uv',
dockerRunArgs: '-v pipcache_hathizip:/.cache/pip',
retry: 2
)
},
'Windows':{
windowsJobs = getToxTestsParallel(
envNamePrefix: 'Tox Windows',
label: 'windows && docker',
dockerfile: 'ci/docker/python/windows/tox/Dockerfile',
dockerArgs: '--build-arg PIP_EXTRA_INDEX_URL --build-arg PIP_INDEX_URL --build-arg CHOCOLATEY_SOURCE --build-arg chocolateyVersion --build-arg PIP_DOWNLOAD_CACHE=c:/users/containeradministrator/appdata/local/pip --build-arg UV_CACHE_DIR=c:/users/containeradministrator/appdata/local/uv',
dockerRunArgs: '-v pipcache_hathizip:c:/users/containeradministrator/appdata/local/pip -v uvcache_hathizip:c:/users/containeradministrator/appdata/local/uv',
retry: 2

)
},
failFast: true
)
parallel{
stage('Linux'){
when{
expression {return nodesByLabel('linux && docker && x86').size() > 0}
}
stage('Run Tox'){
parallel(windowsJobs + linuxJobs)
steps{
script{
parallel(
getToxTestsParallel(
envNamePrefix: 'Tox Linux',
label: 'linux && docker',
dockerfile: 'ci/docker/python/linux/tox/Dockerfile',
dockerArgs: '--build-arg PIP_EXTRA_INDEX_URL --build-arg PIP_INDEX_URL --build-arg PIP_DOWNLOAD_CACHE=/.cache/pip --build-arg UV_CACHE_DIR=/.cache/uv',
dockerRunArgs: '-v pipcache_hathizip:/.cache/pip',
retry: 2
)
)
}
}
}
stage('Windows'){
when{
expression {return nodesByLabel('windows && docker && x86').size() > 0}
}
steps{
script{
parallel(
getToxTestsParallel(
envNamePrefix: 'Tox Windows',
label: 'windows && docker',
dockerfile: 'ci/docker/python/windows/tox/Dockerfile',
dockerArgs: '--build-arg PIP_EXTRA_INDEX_URL --build-arg PIP_INDEX_URL --build-arg CHOCOLATEY_SOURCE --build-arg chocolateyVersion --build-arg PIP_DOWNLOAD_CACHE=c:/users/containeradministrator/appdata/local/pip --build-arg UV_CACHE_DIR=c:/users/containeradministrator/appdata/local/uv',
dockerRunArgs: '-v pipcache_hathizip:c:/users/containeradministrator/appdata/local/pip -v uvcache_hathizip:c:/users/containeradministrator/appdata/local/uv',
retry: 2

)
)
}
}
}
}
Expand Down

0 comments on commit b4deb93

Please sign in to comment.