ci: Add Python version input to setup-uv action and update workflow configuration (#5288)

* feat: add input for Python version in setup-uv action

* Introduced a new input parameter 'python-version' to allow users to specify the Python version for the setup-uv action, defaulting to 3.12.
* Updated the action to use the new input instead of relying on a version file.

* fix: update Python version setup in GitHub Actions workflow

* Changed the Python version setup in the GitHub Actions workflow to use a matrix input instead of a version file, enhancing flexibility and allowing for dynamic version specification.
* This change applies to both the main job and the test job in the workflow configuration.

* chore: update Python version in GitHub Actions workflow to 3.12

* Changed the Python version setup in the GitHub Actions workflow from using a version file to directly specifying Python 3.12, ensuring consistency and clarity in the environment configuration.

* chore: add environment variables for OpenAI and Astra DB in GitHub Actions workflow

* Introduced new environment variables for OPENAI_API_KEY, ASTRA_DB_API_ENDPOINT, and ASTRA_DB_APPLICATION_TOKEN in the store_pytest_durations.yml workflow file to enhance integration capabilities and secure access to necessary APIs.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-12-16 22:48:50 -03:00 committed by GitHub
commit cebf4b103b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 4 deletions

View file

@ -1,6 +1,11 @@
name: "Setup uv"
description: "Checks out code, installs uv, and sets up Python environment"
inputs:
python-version:
description: "Python version to use"
default: "3.12"
runs:
using: "composite"
steps:
@ -13,7 +18,7 @@ runs:
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"
python-version: ${{ inputs.python-version }}
- name: Restore uv cache
uses: actions/cache@v4

View file

@ -57,7 +57,7 @@ jobs:
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"
python-version: ${{ matrix.python-version }}
- name: Restore uv cache
uses: actions/cache@v4
with:
@ -94,7 +94,7 @@ jobs:
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"
python-version: ${{ matrix.python-version }}
- name: Restore uv cache
uses: actions/cache@v4
with:

View file

@ -17,6 +17,9 @@ jobs:
contents: write
pull-requests: write
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ASTRA_DB_API_ENDPOINT: ${{ secrets.ASTRA_DB_API_ENDPOINT }}
ASTRA_DB_APPLICATION_TOKEN: ${{ secrets.ASTRA_DB_APPLICATION_TOKEN }}
UV_CACHE_DIR: /tmp/.uv-cache
steps:
- uses: actions/checkout@v4
@ -28,7 +31,7 @@ jobs:
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"
python-version: "3.12"
- name: Restore uv cache
uses: actions/cache@v4
with: