switch titiler.xarray to obstore+zarr and add default application #1781
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 every pull request, but only on push to main | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - '*' | |
| paths: | |
| # Only run test and docker publish if some code have changed | |
| - 'setup.py' | |
| - 'setup.cfg' | |
| - 'src/titiler/**' | |
| - '.pre-commit-config.yaml' | |
| - '.github/codecov.yml' | |
| - 'dockerfiles/**' | |
| pull_request: | |
| workflow_dispatch: | |
| env: | |
| LATEST_PY_VERSION: '3.13' | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.11', '3.12', '3.13'] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "0.9.*" | |
| enable-cache: true | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| uv sync | |
| - name: Test titiler.core | |
| run: | | |
| uv run pytest src/titiler/core --cov=titiler.core --cov-report=xml --cov-append --cov-report=term-missing | |
| - name: Test titiler.extensions | |
| run: | | |
| uv run pytest src/titiler/extensions --cov=titiler.extensions --cov-report=xml --cov-append --cov-report=term-missing | |
| - name: Test titiler.xarray | |
| run: | | |
| uv run pytest src/titiler/xarray --cov=titiler.xarray --cov-report=xml --cov-append --cov-report=term-missing | |
| - name: Test titiler.mosaic | |
| run: | | |
| uv run pytest src/titiler/mosaic --cov=titiler.mosaic --cov-report=xml --cov-append --cov-report=term-missing | |
| - name: Test titiler.application | |
| run: | | |
| uv run pytest src/titiler/application --cov=titiler.application --cov-report=xml --cov-append --cov-report=term-missing | |
| - name: run pre-commit | |
| if: ${{ matrix.python-version == env.LATEST_PY_VERSION }} | |
| run: | | |
| uv run pre-commit run --all-files | |
| - name: Upload Results | |
| if: ${{ matrix.python-version == env.LATEST_PY_VERSION }} | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| file: ./coverage.xml | |
| flags: unittests | |
| name: ${{ matrix.python-version }} | |
| fail_ci_if_error: false | |
| publish: | |
| needs: [tests] | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "0.9.*" | |
| enable-cache: true | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| uv sync | |
| - name: Set tag version | |
| id: tag | |
| run: | | |
| echo "version=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | |
| - name: Set module version | |
| id: module | |
| run: | | |
| echo "version=$(uv version --short)" >> $GITHUB_OUTPUT | |
| - name: Build and publish titiler packages | |
| if: ${{ steps.tag.outputs.version }} == ${{ steps.module.outputs.version}} | |
| env: | |
| UV_PUBLISH_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
| UV_PUBLISH_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
| run: | | |
| scripts/publish | |
| publish-docker: | |
| needs: [tests] | |
| if: github.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| if: github.repository == 'developmentseed/titiler' | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Log in to the GitHub Container registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: | | |
| ghcr.io/${{ github.repository }} | |
| flavor: | | |
| latest=false | |
| tags: | | |
| type=semver,pattern={{version}} | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| # TODO: add `linux/arm64 once https://github.com/rasterio/rasterio-wheels/issues/69 is resolved | |
| platforms: linux/amd64 # ,linux/arm64 | |
| context: . | |
| file: dockerfiles/Dockerfile | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |