Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: tox stages doesn't stall if no agents have the required labels #114

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading