From a4355caabef688a3e8c34e46980de73f5100bd7a Mon Sep 17 00:00:00 2001 From: Christophe Bornet Date: Thu, 20 Feb 2025 12:15:05 +0100 Subject: [PATCH] feat: Fix Python versions used in CI (#6725) fix: Fix Python versions used in CI --- .github/workflows/codeflash.yml | 6 ++-- .github/workflows/codspeed.yml | 4 ++- .github/workflows/docker-build.yml | 2 ++ .github/workflows/integration_tests.yml | 2 ++ .github/workflows/lint-py.yml | 2 ++ .github/workflows/python_test.yml | 36 ++++---------------- .github/workflows/store_pytest_durations.yml | 19 ++--------- .github/workflows/style-check-py.yml | 2 ++ 8 files changed, 21 insertions(+), 52 deletions(-) diff --git a/.github/workflows/codeflash.yml b/.github/workflows/codeflash.yml index 63dd55a45..83656ddbe 100644 --- a/.github/workflows/codeflash.yml +++ b/.github/workflows/codeflash.yml @@ -22,10 +22,8 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: astral-sh/setup-uv@v5 - with: - enable-cache: true - python-version: "3.12" + - name: "Setup Environment" + uses: ./.github/actions/setup-uv - run: uv sync --extra dev - name: Run Codeflash Optimizer working-directory: ./src/backend/base diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml index 42d4be011..96ff87070 100644 --- a/.github/workflows/codspeed.yml +++ b/.github/workflows/codspeed.yml @@ -25,12 +25,14 @@ jobs: strategy: matrix: python-version: - - "3.13" + - "3.12" steps: - name: Check out the code at a specific ref uses: actions/checkout@v4 - name: "Setup Environment" uses: ./.github/actions/setup-uv + with: + python-version: ${{ matrix.python-version }} - name: Run benchmarks uses: CodSpeedHQ/action@v3 with: diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 5307fffb8..daa8ccca0 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -314,6 +314,8 @@ jobs: ref: ${{ inputs.ref || inputs.main_version || github.ref }} - name: "Setup Environment" uses: ./.github/actions/setup-uv + with: + python-version: ${{ matrix.python-version }} - name: Restart HuggingFace Spaces Build run: | diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index df5480ac3..f74585bbd 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -44,6 +44,8 @@ jobs: ref: ${{ inputs.ref || github.ref }} - name: "Setup Environment" uses: ./.github/actions/setup-uv + with: + python-version: ${{ matrix.python-version }} - 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 937de410d..51955d033 100644 --- a/.github/workflows/lint-py.yml +++ b/.github/workflows/lint-py.yml @@ -30,6 +30,8 @@ jobs: persist-credentials: true - name: "Setup Environment" uses: ./.github/actions/setup-uv + with: + python-version: ${{ matrix.python-version }} - name: Install the project run: uv sync --dev - name: Run Mypy diff --git a/.github/workflows/python_test.yml b/.github/workflows/python_test.yml index 9795dd433..a98a75184 100644 --- a/.github/workflows/python_test.yml +++ b/.github/workflows/python_test.yml @@ -49,23 +49,10 @@ jobs: id: setup-node with: node-version: ${{ env.NODE_VERSION }} - - name: Install uv - uses: astral-sh/setup-uv@v5 - with: - enable-cache: true - cache-dependency-glob: "uv.lock" - - name: "Set up Python" - uses: actions/setup-python@v5 + - name: "Setup Environment" + uses: ./.github/actions/setup-uv with: python-version: ${{ matrix.python-version }} - - name: Restore uv cache - uses: actions/cache@v4 - with: - path: /tmp/.uv-cache - key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} - restore-keys: | - uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} - uv-${{ runner.os }} - name: Install the project run: uv sync --dev - name: Run unit tests @@ -86,23 +73,10 @@ jobs: - uses: actions/checkout@v4 with: ref: ${{ inputs.ref || github.ref }} - - name: Install uv - uses: astral-sh/setup-uv@v5 - with: - enable-cache: true - cache-dependency-glob: "uv.lock" - - name: "Set up Python" - uses: actions/setup-python@v5 + - name: "Setup Environment" + uses: ./.github/actions/setup-uv with: python-version: ${{ matrix.python-version }} - - name: Restore uv cache - uses: actions/cache@v4 - with: - path: /tmp/.uv-cache - key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} - restore-keys: | - uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} - uv-${{ runner.os }} - name: Install the project run: uv sync --dev - name: Run integration tests @@ -122,6 +96,8 @@ jobs: ref: ${{ inputs.ref || github.ref }} - name: "Setup Environment" uses: ./.github/actions/setup-uv + with: + python-version: ${{ matrix.python-version }} - name: Check Version id: check-version diff --git a/.github/workflows/store_pytest_durations.yml b/.github/workflows/store_pytest_durations.yml index 4c22e2715..1756b1563 100644 --- a/.github/workflows/store_pytest_durations.yml +++ b/.github/workflows/store_pytest_durations.yml @@ -23,23 +23,8 @@ jobs: UV_CACHE_DIR: /tmp/.uv-cache steps: - uses: actions/checkout@v4 - - name: Install uv - uses: astral-sh/setup-uv@v5 - with: - enable-cache: true - cache-dependency-glob: "uv.lock" - - name: "Set up Python" - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - name: Restore uv cache - uses: actions/cache@v4 - with: - path: /tmp/.uv-cache - key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} - restore-keys: | - uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} - uv-${{ runner.os }} + - name: "Setup Environment" + uses: ./.github/actions/setup-uv - name: Install the project run: uv sync --dev - name: Run unit tests diff --git a/.github/workflows/style-check-py.yml b/.github/workflows/style-check-py.yml index 392c10f93..593d291fc 100644 --- a/.github/workflows/style-check-py.yml +++ b/.github/workflows/style-check-py.yml @@ -19,6 +19,8 @@ jobs: uses: actions/checkout@v4 - name: "Setup Environment" uses: ./.github/actions/setup-uv + with: + python-version: ${{ matrix.python-version }} - name: Register problem matcher run: echo "::add-matcher::.github/workflows/matchers/ruff.json" - name: Run Ruff Check