Skip to content

Search by product ids #3401

Search by product ids

Search by product ids #3401

Workflow file for this run

---
name: Tests
on:
pull_request:
paths: &paths
- '**'
- '!docs/**'
- '!*.rst'
- '!*.md'
- '!.github/**'
- '.github/workflows/test.yml'
push:
branches:
- develop
- integrate_1.9
paths: *paths
release:
types:
- published
workflow_dispatch:
env:
DOCKER_IMAGE: ghcr.io/opendatacube/explorer: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:
integration-tests:
timeout-minutes: 30
runs-on: ubuntu-latest
permissions:
id-token: write
strategy:
fail-fast: false
matrix:
# Tests take a long time, so split them over multiple CI jobs.
# Ignoring tests inverts the logic which makes it harder to understand,
# but ignoring tests ensures that any added test will be run by at least
# one CI job, even if the test was added outside the current structure.
ignored-tests:
- "test_{[a-oq-z],pages}" # Tests test_page_loads
- "test_{[a-rt-z],s2,stores,su}" # Tests test_stac
- "test_{[a-rt-z],s2,stac,stores}" # Tests test_summarise_data
- "test_{page_,stac,summarise}" # Tests remaining tests
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
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 cubedash)
echo "TIMESTAMP=$TIMESTAMP" >> $GITHUB_ENV
UNSTABLE_TAG=$(git describe --tags)
echo "UNSTABLE_TAG=$UNSTABLE_TAG" >> $GITHUB_ENV
EXPLORER_VERSION=$(git describe --tags | sed 's#\-g#+g#')
echo "EXPLORER_VERSION=$EXPLORER_VERSION" >> $GITHUB_ENV
- name: Build Docker
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
with:
file: Dockerfile
context: .
build-args: |
ENVIRONMENT=test
EXPLORER_VERSION=${{ env.EXPLORER_VERSION }}
tags: ${{ env.DOCKER_IMAGE }}
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
env:
SOURCE_DATE_EPOCH: ${{ env.TIMESTAMP }}
- name: Run tests
shell: bash
run: |
files=$(ls integration_tests/${{ matrix.ignored-tests }}*.py)
[ $? = 0 ] || (echo "Listing tests failed" && exit 1)
for f in $files; do
ig="$ig --ignore=$f";
done
export LOCAL_UID=$(id -u $USER)
export LOCAL_GID=$(id -g $USER)
make up-d
make PYTEST_PARAMS="$ig" test-docker
- name: Upload coverage to Codecov
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
with:
files: ./coverage.xml
disable_search: true
fail_ci_if_error: false
use_oidc: true
test-package:
timeout-minutes: 15
runs-on: ubuntu-latest
needs: integration-tests
permissions:
id-token: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
fetch-tags: true
persist-credentials: false
- 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