From cebf4b103b4257f53e2a7264be016d5c3102cd30 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Mon, 16 Dec 2024 22:48:50 -0300 Subject: [PATCH] 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. --- .github/actions/setup-uv/action.yml | 7 ++++++- .github/workflows/python_test.yml | 4 ++-- .github/workflows/store_pytest_durations.yml | 5 ++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/actions/setup-uv/action.yml b/.github/actions/setup-uv/action.yml index 1b75878f3..d845bd799 100644 --- a/.github/actions/setup-uv/action.yml +++ b/.github/actions/setup-uv/action.yml @@ -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 diff --git a/.github/workflows/python_test.yml b/.github/workflows/python_test.yml index d0f0dfeeb..3d6fbb47f 100644 --- a/.github/workflows/python_test.yml +++ b/.github/workflows/python_test.yml @@ -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: diff --git a/.github/workflows/store_pytest_durations.yml b/.github/workflows/store_pytest_durations.yml index 89c28e44c..c7a11e76a 100644 --- a/.github/workflows/store_pytest_durations.yml +++ b/.github/workflows/store_pytest_durations.yml @@ -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: