chore: update linting workflows to include dev branch in merge_group

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-06-24 10:51:43 -03:00
commit 2102c1d5f2
4 changed files with 25 additions and 1 deletions

View file

@ -4,6 +4,8 @@ on:
pull_request: pull_request:
paths: paths:
- "src/frontend/**" - "src/frontend/**"
merge_group:
branches: [dev]
env: env:
NODE_VERSION: "21" NODE_VERSION: "21"

View file

@ -7,6 +7,8 @@ on:
- "pyproject.toml" - "pyproject.toml"
- "src/backend/**" - "src/backend/**"
- "tests/**" - "tests/**"
merge_group:
branches: [dev]
env: env:
POETRY_VERSION: "1.8.2" POETRY_VERSION: "1.8.2"

View file

@ -1,4 +1,4 @@
name: test name: Python tests
on: on:
push: push:
@ -13,6 +13,8 @@ on:
- "poetry.lock" - "poetry.lock"
- "pyproject.toml" - "pyproject.toml"
- "src/backend/**" - "src/backend/**"
merge_group:
branches: [dev]
env: env:
POETRY_VERSION: "1.8.2" POETRY_VERSION: "1.8.2"
@ -43,3 +45,19 @@ jobs:
- name: Run unit tests - name: Run unit tests
run: | run: |
make unit_tests args="-n auto" make unit_tests args="-n auto"
- name: Test CLI
run: |
poetry run python -m langflow run --host 127.0.0.1 --port 7860 --backend-only &
SERVER_PID=$!
# Wait for the server to start
timeout 120 bash -c 'until curl -f http://127.0.0.1:7860/health; do sleep 2; done' || (echo "Server did not start in time" && kill $SERVER_PID && exit 1)
# Terminate the server
kill $SERVER_PID || (echo "Failed to terminate the server" && exit 1)
sleep 10 # give the server some time to terminate
# Check if the server is still running
if kill -0 $SERVER_PID 2>/dev/null; then
echo "Failed to terminate the server"
exit 1
else
echo "Server terminated successfully"
fi

View file

@ -7,6 +7,8 @@ on:
- "pyproject.toml" - "pyproject.toml"
- "src/backend/**" - "src/backend/**"
- "tests/**" - "tests/**"
merge_group:
branches: [dev]
env: env:
POETRY_VERSION: "1.8.2" POETRY_VERSION: "1.8.2"