Add pytest for YouTube agent #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: tests | |
on: [pull_request] | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11", "3.12"] | |
steps: | |
# Checkout the repository | |
- uses: actions/checkout@v3 | |
# Set up Python | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# Set up pip cache | |
- name: Set up pip cache | |
if: runner.os == 'Linux' | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }} | |
restore-keys: ${{ runner.os }}-pip- | |
# Install Hatch | |
- name: Install Hatch | |
run: pipx install hatch | |
# Run tests with OpenAI API key | |
- name: Run tests | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
run: hatch test |