Merge pull request #917 from PrefectHQ/logfire #2183
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: Run Tests | |
env: | |
# enable colored output | |
# https://github.com/pytest-dev/pytest/issues/7443 | |
PY_COLORS: 1 | |
on: | |
push: | |
branches: ["main"] | |
paths: | |
- .github/workflows/run-tests.yml | |
- src/** | |
- tests/** | |
- pyproject.toml | |
- setup.py | |
pull_request: | |
paths: | |
- .github/workflows/run-tests.yml | |
- src** | |
- tests/** | |
- pyproject.toml | |
- setup.py | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
run_tests: | |
name: ${{ matrix.test-type == '' && 'all' || matrix.test-type }} (Python ${{ matrix.python-version }} on ${{ matrix.os }}) | |
timeout-minutes: 15 | |
strategy: | |
matrix: | |
# run no_llm tests across all python versions and oses | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ['3.9', '3.10', '3.11', '3.12'] | |
test-type: ['no_llm'] | |
include: | |
# Run LLM tests on 3.9 | |
- python-version: '3.9' | |
os: 'ubuntu-latest' | |
test-type: '' | |
runs-on: ${{ matrix.os }} | |
env: | |
MARVIN_OPENAI_API_KEY: ${{ secrets.MARVIN_OPENAI_API_KEY }} | |
MARVIN_ANTHROPIC_API_KEY: ${{ secrets.MARVIN_ANTHROPIC_API_KEY }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
- name: Install Marvin | |
run: pip install ".[tests]" | |
- name: Run tests without LLMs | |
run: pytest -n auto -vv -m "${{ matrix.test-type }}" | |
if: ${{ !(github.event.pull_request.head.repo.fork) && matrix.test-type != '' }} | |
- name: Run tests | |
run: pytest -n auto -vv | |
if: ${{ !(github.event.pull_request.head.repo.fork) && matrix.test-type == '' }} |