From b378eb81d007ec90cba5ef8cc1f0760bf5f7f3d9 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Wed, 11 Jun 2025 15:56:04 -0300 Subject: [PATCH] chore(ci): replace local uv setup action with astral-sh/setup-uv@v6 (#8491) * chore: remove setup-uv action configuration file as it is no longer needed * chore: update setup-uv action to use the official action across all workflows * chore: disable cache pruning in all workflows to improve build stability * chore: update Python version to 3.13 and add pre-release description in workflows --- .github/actions/setup-uv/action.yml | 17 -------------- .github/workflows/codeflash.yml | 10 +++++--- .github/workflows/docker-build.yml | 15 +++++++++--- .github/workflows/integration_tests.yml | 5 +++- .github/workflows/lint-py.yml | 8 ++++--- .github/workflows/nightly_build.yml | 7 +++++- .github/workflows/py_autofix.yml | 6 ++--- .github/workflows/python_test.yml | 24 ++++++++++++-------- .github/workflows/release.yml | 14 ++++++++++-- .github/workflows/release_nightly.yml | 14 ++++++++++-- .github/workflows/store_pytest_durations.yml | 10 +++++--- .github/workflows/style-check-py.yml | 8 ++++--- .github/workflows/typescript_test.yml | 9 ++++++-- 13 files changed, 94 insertions(+), 53 deletions(-) delete mode 100644 .github/actions/setup-uv/action.yml diff --git a/.github/actions/setup-uv/action.yml b/.github/actions/setup-uv/action.yml deleted file mode 100644 index d3ebcb308..000000000 --- a/.github/actions/setup-uv/action.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: "Setup uv" -description: "Checks out code, installs uv, and sets up Python environment" - -inputs: - python-version: - description: "Python version to use" - default: "3.13" - -runs: - using: "composite" - steps: - - name: Install uv - uses: astral-sh/setup-uv@v6 - with: - enable-cache: true - cache-dependency-glob: "uv.lock" - python-version: ${{ inputs.python-version }} diff --git a/.github/workflows/codeflash.yml b/.github/workflows/codeflash.yml index 843c37e3a..b61c58830 100644 --- a/.github/workflows/codeflash.yml +++ b/.github/workflows/codeflash.yml @@ -23,11 +23,15 @@ jobs: with: fetch-depth: 0 - name: "Setup Environment" - uses: ./.github/actions/setup-uv + uses: astral-sh/setup-uv@v6 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" + python-version: ${{ matrix.python-version }} + prune-cache: false - run: uv sync - name: Run Codeflash Optimizer working-directory: ./src/backend/base continue-on-error: true run: uv run codeflash - - name: Minimize uv cache - run: uv cache prune --ci + diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 80761d291..9890be751 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -39,6 +39,7 @@ on: required: true type: string pre_release: + description: "Whether this is a pre-release." required: false type: boolean default: false @@ -49,7 +50,7 @@ on: env: - POETRY_VERSION: "1.8.2" + PYTHON_VERSION: "3.13" TEST_TAG: "langflowai/langflow:test" jobs: @@ -191,7 +192,12 @@ jobs: ref: ${{ inputs.ref || inputs.main_version || github.ref }} persist-credentials: true - name: "Setup Environment" - uses: ./.github/actions/setup-uv + uses: astral-sh/setup-uv@v6 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" + python-version: ${{ env.PYTHON_VERSION }} + prune-cache: false - name: Install the project run: | if [[ "${{ inputs.release_type }}" == "base" || "${{ inputs.release_type }}" == "nightly-base" ]]; then @@ -337,9 +343,12 @@ jobs: with: ref: ${{ inputs.ref || inputs.main_version || github.ref }} - name: "Setup Environment" - uses: ./.github/actions/setup-uv + uses: astral-sh/setup-uv@v6 with: + enable-cache: true + cache-dependency-glob: "uv.lock" python-version: ${{ matrix.python-version }} + prune-cache: false - name: Restart HuggingFace Spaces Build run: | diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 4121b178a..55d2f6661 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -44,9 +44,12 @@ jobs: with: ref: ${{ inputs.ref || github.ref }} - name: "Setup Environment" - uses: ./.github/actions/setup-uv + uses: astral-sh/setup-uv@v6 with: + enable-cache: true + cache-dependency-glob: "uv.lock" python-version: ${{ matrix.python-version }} + prune-cache: false - name: Run integration tests with api keys timeout-minutes: 20 run: | diff --git a/.github/workflows/lint-py.yml b/.github/workflows/lint-py.yml index 471dc30e7..6a8f90024 100644 --- a/.github/workflows/lint-py.yml +++ b/.github/workflows/lint-py.yml @@ -30,9 +30,12 @@ jobs: ref: ${{ inputs.branch || github.ref }} persist-credentials: true - name: "Setup Environment" - uses: ./.github/actions/setup-uv + uses: astral-sh/setup-uv@v6 with: + enable-cache: true + cache-dependency-glob: "uv.lock" python-version: ${{ matrix.python-version }} + prune-cache: false - name: Install the project run: uv sync - name: Run Mypy @@ -40,5 +43,4 @@ jobs: uv run mypy --namespace-packages -p "langflow" env: GITHUB_TOKEN: ${{ secrets.github_token }} - - name: Minimize uv cache - run: uv cache prune --ci + diff --git a/.github/workflows/nightly_build.yml b/.github/workflows/nightly_build.yml index 976bc26ac..5088d1748 100644 --- a/.github/workflows/nightly_build.yml +++ b/.github/workflows/nightly_build.yml @@ -29,7 +29,12 @@ jobs: with: persist-credentials: true - name: "Setup Environment" - uses: ./.github/actions/setup-uv + uses: astral-sh/setup-uv@v6 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" + python-version: ${{ env.PYTHON_VERSION }} + prune-cache: false - name: Install the project run: uv sync diff --git a/.github/workflows/py_autofix.yml b/.github/workflows/py_autofix.yml index 453b78119..468c4c45a 100644 --- a/.github/workflows/py_autofix.yml +++ b/.github/workflows/py_autofix.yml @@ -17,8 +17,7 @@ jobs: - run: uv run ruff check --fix-only . - run: uv run ruff format . --config pyproject.toml - uses: autofix-ci/action@551dded8c6cc8a1054039c8bc0b8b48c51dfc6ef - - name: Minimize uv cache - run: uv cache prune --ci + update-starter-projects: name: Update Starter Projects @@ -38,6 +37,5 @@ jobs: - uses: autofix-ci/action@551dded8c6cc8a1054039c8bc0b8b48c51dfc6ef - - name: Minimize uv cache - run: uv cache prune --ci + diff --git a/.github/workflows/python_test.yml b/.github/workflows/python_test.yml index b9ec6e7af..878390714 100644 --- a/.github/workflows/python_test.yml +++ b/.github/workflows/python_test.yml @@ -48,9 +48,12 @@ jobs: with: node-version: ${{ env.NODE_VERSION }} - name: "Setup Environment" - uses: ./.github/actions/setup-uv + uses: astral-sh/setup-uv@v6 with: + enable-cache: true + cache-dependency-glob: "uv.lock" python-version: ${{ matrix.python-version }} + prune-cache: false - name: Install the project run: uv sync - name: Run unit tests @@ -59,8 +62,7 @@ jobs: timeout_minutes: 12 max_attempts: 2 command: make unit_tests args="-x -vv --splits ${{ matrix.splitCount }} --group ${{ matrix.group }} --reruns 5" - - name: Minimize uv cache - run: uv cache prune --ci + integration-tests: name: Integration Tests - Python ${{ matrix.python-version }} runs-on: ubuntu-latest @@ -72,15 +74,17 @@ jobs: with: ref: ${{ inputs.ref || github.ref }} - name: "Setup Environment" - uses: ./.github/actions/setup-uv + uses: astral-sh/setup-uv@v6 with: + enable-cache: true + cache-dependency-glob: "uv.lock" python-version: ${{ matrix.python-version }} + prune-cache: false - name: Install the project run: uv sync - name: Run integration tests run: make integration_tests_no_api_keys - - name: Minimize uv cache - run: uv cache prune --ci + test-cli: name: Test CLI - Python ${{ matrix.python-version }} runs-on: ubuntu-latest @@ -93,9 +97,12 @@ jobs: with: ref: ${{ inputs.ref || github.ref }} - name: "Setup Environment" - uses: ./.github/actions/setup-uv + uses: astral-sh/setup-uv@v6 with: + enable-cache: true + cache-dependency-glob: "uv.lock" python-version: ${{ matrix.python-version }} + prune-cache: false - name: Check Version id: check-version @@ -145,5 +152,4 @@ jobs: else echo "Server terminated successfully" fi - - name: Minimize uv cache - run: uv cache prune --ci + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a2c408767..4bd13854d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -63,7 +63,12 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - name: Setup Environment - uses: ./.github/actions/setup-uv + uses: astral-sh/setup-uv@v6 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" + python-version: "3.13" + prune-cache: false - name: Install the project run: uv sync - name: Check Version @@ -127,7 +132,12 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - name: Setup Environment - uses: ./.github/actions/setup-uv + uses: astral-sh/setup-uv@v6 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" + python-version: "3.13" + prune-cache: false - name: Install the project run: uv sync diff --git a/.github/workflows/release_nightly.yml b/.github/workflows/release_nightly.yml index 5e69ab0bf..b10577133 100644 --- a/.github/workflows/release_nightly.yml +++ b/.github/workflows/release_nightly.yml @@ -73,7 +73,12 @@ jobs: ref: ${{ inputs.nightly_tag_main }} persist-credentials: true - name: "Setup Environment" - uses: ./.github/actions/setup-uv + uses: astral-sh/setup-uv@v6 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" + python-version: ${{ env.PYTHON_VERSION }} + prune-cache: false - name: Install the project run: uv sync @@ -150,7 +155,12 @@ jobs: ref: ${{ inputs.nightly_tag_main}} persist-credentials: true - name: "Setup Environment" - uses: ./.github/actions/setup-uv + uses: astral-sh/setup-uv@v6 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" + python-version: ${{ env.PYTHON_VERSION }} + prune-cache: false - name: Install the project run: uv sync diff --git a/.github/workflows/store_pytest_durations.yml b/.github/workflows/store_pytest_durations.yml index bcea975da..eb02e6b25 100644 --- a/.github/workflows/store_pytest_durations.yml +++ b/.github/workflows/store_pytest_durations.yml @@ -23,15 +23,19 @@ jobs: steps: - uses: actions/checkout@v4 - name: "Setup Environment" - uses: ./.github/actions/setup-uv + uses: astral-sh/setup-uv@v6 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" + python-version: "3.13" + prune-cache: false - name: Install the project run: uv sync - name: Run unit tests id: run_tests continue-on-error: true run: uv run pytest src/backend/tests/unit --timeout=120 --durations-path src/backend/tests/.test_durations --splitting-algorithm least_duration --store-durations - - name: Minimize uv cache - run: uv cache prune --ci + - name: Close existing PRs uses: actions/github-script@v7 diff --git a/.github/workflows/style-check-py.yml b/.github/workflows/style-check-py.yml index e997e07a7..eefb0f80e 100644 --- a/.github/workflows/style-check-py.yml +++ b/.github/workflows/style-check-py.yml @@ -18,12 +18,14 @@ jobs: - name: Check out the code at a specific ref uses: actions/checkout@v4 - name: "Setup Environment" - uses: ./.github/actions/setup-uv + uses: astral-sh/setup-uv@v6 with: + enable-cache: true + cache-dependency-glob: "uv.lock" python-version: ${{ matrix.python-version }} + prune-cache: false - name: Register problem matcher run: echo "::add-matcher::.github/workflows/matchers/ruff.json" - name: Run Ruff Check run: uv run --only-dev ruff check --output-format=github . - - name: Minimize uv cache - run: uv cache prune --ci + diff --git a/.github/workflows/typescript_test.yml b/.github/workflows/typescript_test.yml index 580d3fcd2..299cf6a8f 100644 --- a/.github/workflows/typescript_test.yml +++ b/.github/workflows/typescript_test.yml @@ -292,8 +292,13 @@ jobs: cd ./src/frontend npx playwright install --with-deps chromium - - name: Setup Python Environment with UV - uses: ./.github/actions/setup-uv + - name: "Setup Environment" + uses: astral-sh/setup-uv@v6 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" + python-version: ${{ env.PYTHON_VERSION }} + prune-cache: false - name: Install Python Dependencies run: uv sync