Skip to content

Commit

Permalink
ci: add version check in workflow to skip jobs for unreleased version…
Browse files Browse the repository at this point in the history
…s of langflow-base (#3244)

feat: add version check in workflow to skip jobs for unreleased versions of langflow-base
  • Loading branch information
ogabrielluiz authored Aug 8, 2024
1 parent 7a36cc9 commit 4d1c8ad
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/python_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,30 @@ jobs:
python-version: ${{ matrix.python-version }}
poetry-version: ${{ env.POETRY_VERSION }}
cache-key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-${{ hashFiles('**/poetry.lock') }}
- name: Check Version
id: check-version
run: |
version=$(cd src/backend/base && poetry version --short)
last_released_version=$(curl -s "https://pypi.org/pypi/langflow-base/json" | jq -r '.releases | keys | .[]' | sort -V | tail -n 1)
if [ "$version" != "$last_released_version" ]; then
echo "Version $version has not been released yet. Skipping the rest of the job."
echo skipped=true >> $GITHUB_OUTPUT
exit 0
else
echo version=$version >> $GITHUB_OUTPUT
echo skipped=false >> $GITHUB_OUTPUT
fi
- name: Build wheel
if: steps.check-version.outputs.skipped == 'false'
run: |
poetry env use ${{ matrix.python-version }}
make build main=true
- name: Install wheel
if: steps.check-version.outputs.skipped == 'false'
run: |
python -m pip install dist/*.whl
- name: Test CLI
if: steps.check-version.outputs.skipped == 'false'
run: |
python -m langflow run --host 127.0.0.1 --port 7860 --backend-only &
SERVER_PID=$!
Expand Down

0 comments on commit 4d1c8ad

Please sign in to comment.