Skip to content

Commit 8a37398

Browse files
committed
Test Git tag / package version coherence
Put this check as the last step of the `test` job and have it conditioned by the workflow being launched on a Git tag, in order to easily factor it out among the 3 potential target release "channels" (GitHub, Test PyPI, and PyPI).
1 parent fa9ca21 commit 8a37398

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/pip.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,16 @@ jobs:
9292
run: |
9393
pip install --upgrade pip
9494
pip install $(ls khiops*.tar.gz)
95+
- name: Test package / Git tag version coherence
96+
if: github.ref_type == 'tag'
97+
run: |
98+
PACKAGE_VERSION=$(pip show khiops | awk 'BEGIN {FS = ": "} $1 ~ /^Version$/ {print $2}')
99+
echo ${{ github.ref_name }} | grep -wq $PACKAGE_VERSION
100+
if [[ $? -ne 0 ]]
101+
then
102+
echo "::error::Python package version $PACKAGE_VERSION does not match Git tag ${{ github.ref_name }}"
103+
false
104+
fi
95105
- name: Run tests
96106
env:
97107
KHIOPS_SAMPLES_DIR: ${{ github.workspace }}/khiops-samples

0 commit comments

Comments
 (0)