diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f655dcc64..4046da231 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,6 +11,10 @@ env: jobs: tests: runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10", "3.11", "3.12"] + fail-fast: false # Allow all matrix jobs to finish even if one fails timeout-minutes: 15 steps: - name: Checkout code @@ -22,8 +26,8 @@ jobs: enable-cache: true - - name: Set up Python - run: uv python install 3.12.8 + - name: Set up Python ${{ matrix.python-version }} + run: uv python install ${{ matrix.python-version }} - name: Install the project run: uv sync --dev --all-extras diff --git a/tests/test_compatibility.py b/tests/test_compatibility.py new file mode 100644 index 000000000..90414b389 --- /dev/null +++ b/tests/test_compatibility.py @@ -0,0 +1,14 @@ +import pytest + +def test_basic_import(): + """ + Tests that the crewai package can be imported without raising exceptions. + This helps catch basic installation and dependency issues, including import + errors related to Python version compatibility. + """ + try: + import crewai + except ImportError as e: + pytest.fail(f"Failed to import crewai package: {e}") + except Exception as e: + pytest.fail(f"An unexpected error occurred during crewai import: {e}")