* 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.
68 lines
2.1 KiB
YAML
68 lines
2.1 KiB
YAML
name: Store pytest durations
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
# Run job at 6:30 UTC, 10.30pm PST, or 11.30pm PDT
|
|
- cron: "30 6 * * *"
|
|
|
|
env:
|
|
PYTEST_RUN_PATH: "src/backend/tests"
|
|
|
|
jobs:
|
|
build:
|
|
name: Run pytest and store durations
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
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
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v4
|
|
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: Install the project
|
|
run: uv sync --dev
|
|
- name: Run unit tests
|
|
uses: nick-fields/retry@v3
|
|
with:
|
|
timeout_minutes: 12
|
|
max_attempts: 2
|
|
command: uv run pytest src/backend/tests --durations-path src/backend/tests/.test_durations --splitting-algorithm least_duration --store-durations
|
|
- name: Minimize uv cache
|
|
run: uv cache prune --ci
|
|
|
|
- name: Create Pull Request
|
|
uses: peter-evans/create-pull-request@v7
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
branch-token: ${{ secrets.GITHUB_TOKEN }}
|
|
commit-message: "chore: update test durations"
|
|
title: "chore: update test durations"
|
|
body: |
|
|
Automated PR to update test durations file.
|
|
|
|
This PR was automatically created by the store_pytest_durations workflow.
|
|
branch: update-test-durations
|
|
branch-suffix: timestamp
|
|
delete-branch: true
|
|
maintainer-can-modify: true
|