Demo ci check (#12530)

* Remove branch checking in workflow files

* Detect demo branch based on software version

* Fix typo
This commit is contained in:
Oliver
2026-08-01 14:53:43 +10:00
committed by GitHub
parent 5216203e0d
commit 175bfda22f
3 changed files with 15 additions and 13 deletions
+12 -2
View File
@@ -1846,7 +1846,7 @@ def test(
'keep': 'Keep existing demo dataset (do not re-clone)',
'validate_files': 'Validate media files are correctly copied',
'use_ssh': 'Use SSH protocol for cloning the demo dataset (requires SSH key)',
'branch': 'Specify branch of demo-dataset to clone (default = main)',
'branch': 'Specify branch of demo-dataset to clone',
'verbose': 'Print verbose output from management commands',
}
)
@@ -1859,7 +1859,7 @@ def setup_test(
use_ssh: bool = False,
verbose: bool = False,
path: str = 'inventree-demo-dataset',
branch='main',
branch: Optional[str] = None,
):
"""Setup a testing environment."""
from src.backend.InvenTree.InvenTree.config import ( # type: ignore[import]
@@ -1882,6 +1882,16 @@ def setup_test(
# Use SSH protocol for cloning the demo dataset
URL = 'git@github.com:inventree/demo-dataset.git'
if not branch:
# No branch specified - determine the InvenTree version
version = get_inventree_version()
# If the version is a stable release (e.g. "1.4.3")
# then we can try to use the corresponding branch in the demo-dataset repository
# (e.g. "1.4.x")
if re.match(r'^\d+\.\d+\.\d+$', version):
branch = f'{version.rsplit(".", 1)[0]}.x'
# InvenTree's trunk branch is named "master", but the demo-dataset
# repository uses "main" as its trunk branch - map this automatically
# so CI can pass through the detected target branch unmodified.