Skip to content

Commit

Permalink
Try fetching tags to get correct version in CI (#281)
Browse files Browse the repository at this point in the history
* Try fetching tags to get correct version in CI

* Cover other checkout actions as well
  • Loading branch information
mgorny authored Feb 25, 2025
1 parent d1ec0e6 commit 456a558
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-python@v3
with:
python-version: 3.12
Expand Down Expand Up @@ -45,6 +47,8 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
fetch-tags: true

- uses: actions/setup-python@v3
with:
Expand All @@ -64,6 +68,8 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
fetch-tags: true

- name: Set up Conda
uses: conda-incubator/setup-miniconda@v3
Expand Down
3 changes: 0 additions & 3 deletions tests/test_binding.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ def test_cmake_static_compilation(csetstr: str):
testprog = os.path.join(tmpdir, "test.cc")
# SKBUILD_PROJECT_VERSION only includes major.minor.patch
versionstr = ".".join(correctionlib.__version__.split(".")[:3])
if versionstr.startswith("0.1.dev1+"):
# band-aid for https://github.com/actions/checkout/issues/249 in CI
versionstr = "0.1"
with open(testprog, "w") as f:
f.write(TESTPROG_SRC % (versionstr, csetstr))
flags = (
Expand Down

0 comments on commit 456a558

Please sign in to comment.