Skip to content

Update dependency openai to v2 - autoclosed #804

Update dependency openai to v2 - autoclosed

Update dependency openai to v2 - autoclosed #804

Workflow file for this run

name: CI - Tests and Pre-commit Checks
on:
push: # Run on push to any branch
pull_request: # Run on pull requests to any branch
workflow_call:
jobs:
pre-commit:
name: Run pre-commit checks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install uv (curl method)
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Cache uv virtualenv
uses: actions/cache@v5
with:
path: .venv
key: uv-venv-${{ runner.os }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
uv-venv-${{ runner.os }}-
- name: Install pre-commit tool with uv
run: |
uv tool install --with pre-commit-uv pre-commit
- name: Setup pre-commit cache
uses: actions/cache@v5
with:
path: ~/.cache/pre-commit
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Determine merge base
id: merge-base
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
MERGE_BASE=$(git merge-base origin/${{ github.base_ref }} HEAD)
else
MERGE_BASE=$(git rev-parse HEAD^)
fi
echo "merge-base=$MERGE_BASE" >> $GITHUB_OUTPUT
shell: bash
- name: Run pre-commit on changed files
run: |
pre-commit run \
--show-diff-on-failure \
--color=always \
--from-ref=${{ steps.merge-base.outputs.merge-base }} \
--to-ref=HEAD
shell: bash
test:
name: Run Python Tests
runs-on: ubuntu-latest
needs: pre-commit
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install uv (curl method)
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Cache uv virtualenv
uses: actions/cache@v5
with:
path: .venv
key: uv-venv-${{ runner.os }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
uv-venv-${{ runner.os }}-
- name: Create virtualenv and install dependencies
run: |
uv sync
- name: Run tests
run: |
uv run pytest