Use puremagic instead of deprecated imghdr for image type detection #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
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| jobs: | |
| unit-tests: | |
| name: Unit tests (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install | |
| run: pip install ".[test]" | |
| - name: Run unit tests | |
| run: pytest tests/test_unit.py -v | |
| integration-tests: | |
| name: Integration tests (real Kidplan API) | |
| runs-on: ubuntu-latest | |
| # Only run on pushes to main — not on PRs from forks (secrets unavailable) | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| needs: unit-tests | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install | |
| run: pip install ".[test]" | |
| - name: Run integration tests | |
| env: | |
| KIDPLAN_USERNAME: ${{ secrets.KIDPLAN_USERNAME }} | |
| KIDPLAN_PASSWORD: ${{ secrets.KIDPLAN_PASSWORD }} | |
| run: pytest tests/test_integration.py -v |