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 911b835 commit 9f1806e
Showing 1 changed file with 98 additions and 88 deletions.
186 changes: 98 additions & 88 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ pipeline {
excludes {
exclude {
axis {
name 'PLATFORM'
name 'OS'
notValues 'windows'
}
axis {
Expand All @@ -474,98 +474,108 @@ pipeline {
}
}
}
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('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'
stage('delme'){
steps{
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'],
]
)
def dummy = params.containsKey("INCLUDE_${OS}-${ARCHITECTURE}".toUpperCase()) && params["INCLUDE_${OS}-${ARCHITECTURE}".toUpperCase()]
echo "dummy = ${dummy}"
echo "ARCHITECTURE = ${ARCHITECTURE}"
echo "OS = ${OS}"
}
}
}
// 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 9f1806e

Please sign in to comment.