Feature/refactor #4
This file contains hidden or 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
| # .github/workflows/ci.yml | |
| name: Python Package CI | |
| # Run on pushes to main and any pull requests | |
| on: | |
| push: | |
| branches: [main] # Or your default branch (e.g., master) | |
| pull_request: | |
| branches: [main] # Or your default branch | |
| jobs: | |
| build_and_test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false # Keep running other matrix jobs even if one fails | |
| matrix: | |
| os: [ubuntu-latest] # Could add macos-latest, windows-latest if needed | |
| # Test against python versions declared compatible in pyproject.toml | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] # Add more versions as needed | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 # Updated version | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 # Updated version | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v3 | |
| with: | |
| version: "latest" | |
| - name: Install dependencies | |
| run: | | |
| uv sync --all-extras --dev | |
| - name: Test with pytest | |
| run: | | |
| uv run pytest tests/ | |
| # Optional, but good practice: Ensure the package builds correctly | |
| - name: Build package | |
| if: matrix.python-version == '3.10' && matrix.os == 'ubuntu-latest' # Only build once | |
| run: uv build |