extend unit tests: inventory edges, input parsing, gridmet, loop_fast… #29
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, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| - name: Set up Python 3.13 | |
| run: uv python install 3.13 | |
| - name: Install project | |
| run: uv sync --all-extras | |
| - name: Check lint (ruff) | |
| run: uv run ruff check . | |
| - name: Check format (ruff) | |
| run: uv run ruff format --check . | |
| test-fast: | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| - name: Set up Python 3.13 | |
| run: uv python install 3.13 | |
| - name: Install system deps | |
| run: sudo apt-get update && sudo apt-get install -y gdal-bin libgdal-dev | |
| - name: Install project | |
| run: uv sync --all-extras | |
| - name: Run fast tests | |
| env: | |
| PROJ_LIB: /usr/share/proj | |
| run: uv run pytest tests/ -m "not slow" -q --tb=short | |
| test-full: | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| - name: Set up Python 3.13 | |
| run: uv python install 3.13 | |
| - name: Install system deps | |
| run: sudo apt-get update && sudo apt-get install -y gdal-bin libgdal-dev | |
| - name: Install project | |
| run: uv sync --all-extras | |
| - name: Run full test suite | |
| env: | |
| PROJ_LIB: /usr/share/proj | |
| run: uv run pytest tests/ -q --tb=short --durations=10 | |
| - name: Run coverage | |
| env: | |
| PROJ_LIB: /usr/share/proj | |
| run: uv run pytest tests/ -m "not parity" -q --cov=swimrs --cov-branch --cov-report=term-missing --cov-report=xml:coverage.xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: coverage.xml | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false |