From 2102c1d5f20ca4be2548ead2ad9813aff2bf327e Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Mon, 24 Jun 2024 10:51:43 -0300 Subject: [PATCH] chore: update linting workflows to include dev branch in merge_group --- .github/workflows/lint-js.yml | 2 ++ .github/workflows/lint-py.yml | 2 ++ .github/workflows/python_test.yml | 20 +++++++++++++++++++- .github/workflows/style-check-py.yml | 2 ++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint-js.yml b/.github/workflows/lint-js.yml index d381a467f..11156c8b8 100644 --- a/.github/workflows/lint-js.yml +++ b/.github/workflows/lint-js.yml @@ -4,6 +4,8 @@ on: pull_request: paths: - "src/frontend/**" + merge_group: + branches: [dev] env: NODE_VERSION: "21" diff --git a/.github/workflows/lint-py.yml b/.github/workflows/lint-py.yml index 95fbb15e6..9dab54eb8 100644 --- a/.github/workflows/lint-py.yml +++ b/.github/workflows/lint-py.yml @@ -7,6 +7,8 @@ on: - "pyproject.toml" - "src/backend/**" - "tests/**" + merge_group: + branches: [dev] env: POETRY_VERSION: "1.8.2" diff --git a/.github/workflows/python_test.yml b/.github/workflows/python_test.yml index 9a8ef15c8..c3c320aad 100644 --- a/.github/workflows/python_test.yml +++ b/.github/workflows/python_test.yml @@ -1,4 +1,4 @@ -name: test +name: Python tests on: push: @@ -13,6 +13,8 @@ on: - "poetry.lock" - "pyproject.toml" - "src/backend/**" + merge_group: + branches: [dev] env: POETRY_VERSION: "1.8.2" @@ -43,3 +45,19 @@ jobs: - name: Run unit tests run: | 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 diff --git a/.github/workflows/style-check-py.yml b/.github/workflows/style-check-py.yml index 3255aa31d..bd7b9dc0e 100644 --- a/.github/workflows/style-check-py.yml +++ b/.github/workflows/style-check-py.yml @@ -7,6 +7,8 @@ on: - "pyproject.toml" - "src/backend/**" - "tests/**" + merge_group: + branches: [dev] env: POETRY_VERSION: "1.8.2"