Skip to content

Commit e8979a7

Browse files
author
ewezy
committed
Add steps to install turing locally when running workflows on a branch
1 parent 83ed25d commit e8979a7

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

.github/workflows/pyfunc-ensembler-job.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ jobs:
5353
- name: Run Tests
5454
working-directory: engines/pyfunc-ensembler-job
5555
run: |
56+
if [[ "${GITHUB_REF##*/}" != "main" ]]; then
57+
echo "Workflow not running on the main branch -> Running tests using SDK files from this branch..."
58+
export OVERWRITE_VERSION="0.0.0"
59+
fi
5660
make setup
5761
make test
5862

.github/workflows/pyfunc-ensembler-service.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ jobs:
4545
- name: Run Tests
4646
working-directory: engines/pyfunc-ensembler-service
4747
run: |
48+
if [[ "${GITHUB_REF##*/}" != "main" ]]; then
49+
echo "Workflow not running on the main branch -> Running tests using SDK files from this branch..."
50+
export OVERWRITE_VERSION="0.0.0"
51+
fi
4852
make setup
4953
make test
5054

engines/pyfunc-ensembler-job/Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,14 @@ version:
5252
build: version
5353
@rm -rf build dist
5454
@pip install "setuptools>=64,<75" "setuptools_scm>=8" "twine" "wheel"
55-
@sed -i -e "s|turing-sdk.*|turing-sdk==$(VERSION)|g" ./requirements.txt
55+
@echo $(VERSION)
56+
@if [ "$(VERSION)" = "0.0.0" ]; then \
57+
echo "🔧 Using local turing-sdk source..."; \
58+
sed -i -e "s|turing-sdk.*|turing-sdk @ file://$(abspath ../../sdk)|g" ./requirements.txt; \
59+
else \
60+
echo "📦 Using turing-sdk version $(VERSION)..."; \
61+
sed -i -e "s|turing-sdk.*|turing-sdk==$(VERSION)|g" ./requirements.txt; \
62+
fi
5663
@sed -i -e "s|VERSION = \".*\"|VERSION = \"$(VERSION)\"|g" ./version.py
5764
@python setup.py sdist bdist_wheel
5865

engines/pyfunc-ensembler-service/Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,14 @@ version:
4545
build: version
4646
@rm -rf build dist
4747
@pip install "setuptools>=64,<75" "setuptools_scm>=8" "twine" "wheel"
48-
@sed -i -e "s|turing-sdk.*|turing-sdk==$(VERSION)|g" ./requirements.txt
48+
@echo $(VERSION)
49+
@if [ "$(VERSION)" = "0.0.0" ]; then \
50+
echo "🔧 Using local turing-sdk source..."; \
51+
sed -i -e "s|turing-sdk.*|turing-sdk @ file://$(abspath ../../sdk)|g" ./requirements.txt; \
52+
else \
53+
echo "📦 Using turing-sdk version $(VERSION)..."; \
54+
sed -i -e "s|turing-sdk.*|turing-sdk==$(VERSION)|g" ./requirements.txt; \
55+
fi
4956
@sed -i -e "s|VERSION = \".*\"|VERSION = \"$(VERSION)\"|g" ./version.py
5057
@python setup.py sdist bdist_wheel
5158

0 commit comments

Comments
 (0)