Skip to content

Commit 4b2a89d

Browse files
committed
Add version check in github workflow
1 parent 865ddc1 commit 4b2a89d

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: CI
22
on: [push, pull_request]
33

4+
env:
5+
HSD_PYTHON_VERSION: '0.1'
6+
47
jobs:
58
test:
69

@@ -24,7 +27,7 @@ jobs:
2427
run: |
2528
python -m build
2629
pip install dist/hsd_python*.whl
27-
python3 -c 'import hsd; print(hsd.__version__)'
30+
python -c "import hsd; assert hsd.__version__ == '${HSD_PYTHON_VERSION}'"
2831
2932
- name: Run test pytest
3033
run: python3 -m pytest

devtools/set_version

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ FILES_PATTERNS = [('src/hsd/__init__.py',
2323
('docs/conf.py',
2424
r'release\s*=\s*([\'"]){}\1'.format(VERSION_PATTERN),
2525
"release = '{version}'"),
26+
('.github/workflows/ci.yml',
27+
r'HSD_PYTHON_VERSION:\s*([\'"]){}\1'.format(VERSION_PATTERN),
28+
"HSD_PYTHON_VERSION: '{version}'"),
2629
]
2730

2831

0 commit comments

Comments
 (0)