Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
test.yml 1.88 KiB
name: Test

on:
  pull_request:
  push:
    branches: [ james/uv-migration ]

jobs:
  build:
    runs-on: ubuntu-latest
    services:
      pinecone:
        image: ghcr.io/pinecone-io/pinecone-local:latest
        env:
          PORT: 5080
          PINECONE_HOST: localhost
        ports:
        - "5080-6000:5080-6000"

    strategy:
      matrix:
        python-version:
        - "3.10"
        - "3.11"
        - "3.12"
        - "3.13"
    steps:
    - uses: actions/checkout@v4
    - name: Cache uv
      uses: actions/cache@v4
      with:
        path: ~/.uv
        key: ${{ runner.os }}-uv-${{ hashFiles('**/uv.lock') }}
        restore-keys: |
          ${{ runner.os }}-uv-

    - name: Wait for Pinecone service to start
      run: |
        echo "Waiting for Pinecone service to start..."
        sleep 10  # Wait for 10 seconds to ensure the container is up

    - name: Install uv
      run: |
        curl -LsSf https://astral.sh/uv/install.sh | sh
    - name: Set up Python ${{ matrix.python-version }}
      run: uv venv --python 3.13
      cache: uv

    # only needed for local testing
    # - name: Add Poetry to PATH
    #   run: echo "PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV

    - name: Install dependencies
      run: uv pip install -e .[dev]
    - name: Install nltk
      run: uv pip install nltk

    - name: Download nltk data
      run: |
        uv python -m nltk.downloader punkt stopwords wordnet punkt_tab

    - name: Pytest All
      env:
        PINECONE_API_KEY: pclocal
        PINECONE_API_BASE_URL: http://localhost:5080
        OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
        COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
      run: |
        make test
    - name: Upload coverage to Codecov