Skip to content

Bypass spatial search (#1627) #3573

Bypass spatial search (#1627)

Bypass spatial search (#1627) #3573

Workflow file for this run

---
name: Tests
on:
pull_request:
branches: &branches
- 'develop'
- 'develop-1.8'
paths: &paths
- '**'
- '!docs/**'
- '!*.rst'
- '!*.md'
- '!datacube_ows/__init__.py'
- '!.github/**'
- '.github/workflows/test.yml'
push:
branches: *branches
paths: *paths
release:
types:
- published
workflow_dispatch:
env:
DOCKER_IMAGE: ghcr.io/opendatacube/ows:tests
permissions: {}
# When a PR is updated, cancel the jobs from the previous version. Merges
# do not define head_ref, so use run_id to never cancel those jobs.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
unit-integration-performance-tests:
timeout-minutes: 45
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
fetch-tags: true
persist-credentials: false
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
- name: Get Git commit timestamps
run: |
TIMESTAMP=$(git log -1 --pretty=%ct pyproject.toml uv.lock datacube_ows)
echo "TIMESTAMP=$TIMESTAMP" >> $GITHUB_ENV
- name: Build Docker
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
with:
file: Dockerfile
context: .
build-args: |
ENVIRONMENT=test
tags: ${{ env.DOCKER_IMAGE }}
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
env:
SOURCE_DATE_EPOCH: ${{ env.TIMESTAMP }}
- name: Test and lint dev OWS image
run: |
mkdir artifacts
docker run -e LOCAL_UID=$(id -u $USER) -e LOCAL_GID=$(id -g $USER) -v ./:/src -v ${PWD}/artifacts:/mnt/artifacts ${{ env.DOCKER_IMAGE }} /bin/sh -c "cd /src && ./check-code.sh"
mv ./artifacts/coverage.xml ./artifacts/coverage-unit.xml
- name: Dockerized Integration Pytest
run: |
export LOCAL_UID=$(id -u $USER)
export LOCAL_GID=$(id -g $USER)
export $(grep -v '^#' .env_simple | xargs)
docker compose -f docker-compose.yaml -f docker-compose.db.yaml up --quiet-pull -d --wait
docker compose -f docker-compose.yaml -f docker-compose.db.yaml exec -T ows /bin/sh -c "cd /src && ./check-code-all.sh"
docker compose -f docker-compose.yaml -f docker-compose.db.yaml down
- name: Upload All coverage to Codecov
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
with:
directory: ./artifacts/
fail_ci_if_error: false
use_oidc: true
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- name: Build Packages
run: |
SETUPTOOLS_SCM_PRETEND_VERSION=$(git describe --abbrev=0 --tags)
export SETUPTOOLS_SCM_PRETEND_VERSION
uv build
uv tool run twine check --strict dist/*
# Uses to OIDC identification between GitHub and PyPI
- name: Upload package to PyPI on GitHub Release
if: "github.repository_owner == 'opendatacube' && github.event.action == 'published'"
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0