fix: resolve all linter errors for CI #3
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, python-adcp-sdk-setup] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| name: Test Python ${{ matrix.python-version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev]" | |
| - name: Run linter | |
| run: | | |
| ruff check src/ | |
| - name: Run type checker | |
| run: | | |
| mypy src/adcp/ | |
| - name: Run tests | |
| run: | | |
| pytest tests/ -v --cov=src/adcp --cov-report=term-missing | |
| schema-check: | |
| name: Validate schemas are up-to-date | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev]" | |
| - name: Download latest schemas | |
| run: python scripts/sync_schemas.py | |
| - name: Fix schema references | |
| run: python scripts/fix_schema_refs.py | |
| - name: Generate models | |
| run: python scripts/generate_models_simple.py | |
| - name: Check for schema drift | |
| run: | | |
| if git diff --exit-code src/adcp/types/tasks.py schemas/cache/; then | |
| echo "✓ Schemas are up-to-date" | |
| else | |
| echo "✗ Schemas are out of date!" | |
| echo "Run: python scripts/sync_schemas.py && python scripts/fix_schema_refs.py && python scripts/generate_models_simple.py" | |
| git diff src/adcp/types/tasks.py | |
| exit 1 | |
| fi |