Skip to content

Commit

Permalink
ci: remove specialized dockerfile for ci testing packages
Browse files Browse the repository at this point in the history
  • Loading branch information
henryborchers committed Oct 21, 2024
1 parent 9f1806e commit 803eff5
Showing 1 changed file with 93 additions and 103 deletions.
196 changes: 93 additions & 103 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -451,11 +451,11 @@ pipeline {
}
axis {
name 'OS'
values 'linux','macos','windows'
values 'linux', 'macos', 'windows'
}
axis {
name 'ARCHITECTURE'
values 'x86_64', 'arm64'
values 'arm64', 'x86_64'
}
axis {
name 'PACKAGE_TYPE'
Expand All @@ -464,118 +464,108 @@ pipeline {
}
excludes {
exclude {
axis {
name 'OS'
notValues 'windows'
}
axis {
name 'ARCHITECTURE'
values 'arm64'
}
axis {
name 'OS'
values 'windows'
}
}
}
when{
expression{
params.containsKey("INCLUDE_${OS}-${ARCHITECTURE}".toUpperCase()) && params["INCLUDE_${OS}-${ARCHITECTURE}".toUpperCase()]
}
}
// when{
// expression{
// params.containsKey("INCLUDE_${OS}-${ARCHITECTURE}".toUpperCase()) && params["INCLUDE_${OS}-${ARCHITECTURE}".toUpperCase()]
// }
// }
stages {
stage('delme'){
steps{
stage('Test Package in container') {
when{
expression{['linux', 'windows'].contains(OS)}
beforeAgent true
}
agent {
docker {
image 'python'
label "${OS} && ${ARCHITECTURE} && docker"
args "--mount source=python-tmp-hathizip,target=${['linux'].contains(OS) ? '/tmp' : 'C:/Users/AppData/Local/Temp'}"
}
}
environment{
PIP_CACHE_DIR="${isUnix() ? '/tmp/pipcache': 'C:/Users/AppData/Local/Temp/pipcache'}"
UV_INDEX_STRATEGY='unsafe-best-match'
UV_TOOL_DIR="${isUnix() ? '/tmp/uvtools': 'C:/Users/AppData/Local/Temp/uvtools'}"
UV_PYTHON_INSTALL_DIR="${isUnix() ? '/tmp/uvpython': 'C:/Users/AppData/Local/Temp/uvpython'}"
UV_CACHE_DIR="${isUnix() ? '/tmp/uvcache': 'C:/Users/AppData/Local/Temp/uvcache'}"
}
steps {
unstash 'PYTHON_PACKAGES'
script{
def dummy = params.containsKey("INCLUDE_${OS}-${ARCHITECTURE}".toUpperCase()) && params["INCLUDE_${OS}-${ARCHITECTURE}".toUpperCase()]
echo "dummy = ${dummy}"
echo "ARCHITECTURE = ${ARCHITECTURE}"
echo "OS = ${OS}"
if(isUnix()){
sh(
label: 'Testing with tox',
script: """python3 -m venv venv
. ./venv/bin/activate
pip install uv
UV_INDEX_STRATEGY=unsafe-best-match uvx --with tox-uv tox --installpkg ${findFiles(glob: PACKAGE_TYPE == 'wheel' ? 'dist/*.whl' : 'dist/*.tar.gz')[0].path} -e py${PYTHON_VERSION.replace('.', '')}
"""
)
} else {
bat(
label: 'Testing with tox',
script: """python -m venv venv
.\\venv\\scripts\\activate.bat
pip install uv
UV_INDEX_STRATEGY=unsafe-best-match uvx --with tox-uv tox --installpkg ${findFiles(glob: PACKAGE_TYPE == 'wheel' ? 'dist/*.whl' : 'dist/*.tar.gz')[0].path} -e py${PYTHON_VERSION.replace('.', '')}
"""
)
}
}
}
post{
cleanup{
cleanWs(
patterns: [
[pattern: 'dist/', type: 'INCLUDE'],
[pattern: 'venv/', type: 'INCLUDE'],
[pattern: '**/__pycache__/', type: 'INCLUDE'],
]
)
}
}
}
stage('Test Package directly on agent') {
when{
expression{['macos'].contains(OS)}
beforeAgent true
}
agent {
label "${OS} && ${ARCHITECTURE}"
}
steps {
unstash 'PYTHON_PACKAGES'
sh(
label: 'Testing with tox',
script: """python3 -m venv venv
. ./venv/bin/activate
pip install uv
UV_INDEX_STRATEGY=unsafe-best-match uvx --with tox-uv tox --installpkg ${findFiles(glob: PACKAGE_TYPE == 'wheel' ? 'dist/*.whl' : 'dist/*.tar.gz')[0].path} -e py${PYTHON_VERSION.replace('.', '')}
"""
)
}
post{
cleanup{
cleanWs(
patterns: [
[pattern: 'dist/', type: 'INCLUDE'],
[pattern: 'venv/', type: 'INCLUDE'],
[pattern: '**/__pycache__/', type: 'INCLUDE'],
]
)
}
}
}
// stage('Test Package in container') {
// when{
// expression{['linux', 'windows'].contains(OS)}
// beforeAgent true
// }
// agent {
// docker {
// image 'python'
// label "${OS} && ${ARCHITECTURE} && docker"
// args "--mount source=python-tmp-hathizip,target=${['linux'].contains(OS) ? '/tmp' : 'C:/Users/AppData/Local/Temp'}"
// }
// }
// environment{
// PIP_CACHE_DIR="${isUnix() ? '/tmp/pipcache': 'C:/Users/AppData/Local/Temp/pipcache'}"
// UV_INDEX_STRATEGY='unsafe-best-match'
// UV_TOOL_DIR="${isUnix() ? '/tmp/uvtools': 'C:/Users/AppData/Local/Temp/uvtools'}"
// UV_PYTHON_INSTALL_DIR="${isUnix() ? '/tmp/uvpython': 'C:/Users/AppData/Local/Temp/uvpython'}"
// UV_CACHE_DIR="${isUnix() ? '/tmp/uvcache': 'C:/Users/AppData/Local/Temp/uvcache'}"
// }
// steps {
// unstash 'PYTHON_PACKAGES'
// script{
// if(isUnix()){
// sh(
// label: 'Testing with tox',
// script: """python3 -m venv venv
// . ./venv/bin/activate
// pip install uv
// UV_INDEX_STRATEGY=unsafe-best-match uvx --with tox-uv tox --installpkg ${findFiles(glob: PACKAGE_TYPE == 'wheel' ? 'dist/*.whl' : 'dist/*.tar.gz')[0].path} -e py${PYTHON_VERSION.replace('.', '')}
// """
// )
// } else {
// bat(
// label: 'Testing with tox',
// script: """python -m venv venv
// .\\venv\\scripts\\activate.bat
// pip install uv
// UV_INDEX_STRATEGY=unsafe-best-match uvx --with tox-uv tox --installpkg ${findFiles(glob: PACKAGE_TYPE == 'wheel' ? 'dist/*.whl' : 'dist/*.tar.gz')[0].path} -e py${PYTHON_VERSION.replace('.', '')}
// """
// )
// }
// }
// }
// post{
// cleanup{
// cleanWs(
// patterns: [
// [pattern: 'dist/', type: 'INCLUDE'],
// [pattern: 'venv/', type: 'INCLUDE'],
// [pattern: '**/__pycache__/', type: 'INCLUDE'],
// ]
// )
// }
// }
// }
// stage('Test Package directly on agent') {
// when{
// expression{['macos'].contains(OS)}
// beforeAgent true
// }
// agent {
// label "${OS} && ${ARCHITECTURE}"
// }
// steps {
// unstash 'PYTHON_PACKAGES'
// sh(
// label: 'Testing with tox',
// script: """python3 -m venv venv
// . ./venv/bin/activate
// pip install uv
// UV_INDEX_STRATEGY=unsafe-best-match uvx --with tox-uv tox --installpkg ${findFiles(glob: PACKAGE_TYPE == 'wheel' ? 'dist/*.whl' : 'dist/*.tar.gz')[0].path} -e py${PYTHON_VERSION.replace('.', '')}
// """
// )
// }
// post{
// cleanup{
// cleanWs(
// patterns: [
// [pattern: 'dist/', type: 'INCLUDE'],
// [pattern: 'venv/', type: 'INCLUDE'],
// [pattern: '**/__pycache__/', type: 'INCLUDE'],
// ]
// )
// }
// }
// }
}
}
}
Expand Down

0 comments on commit 803eff5

Please sign in to comment.