Bump version number and core dependency #4222
Workflow file for this run
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
| # yamllint disable-file | |
| name: Run Code Checks | |
| on: | |
| pull_request: | |
| push: | |
| # Only run on push to `develop` branch to prevent double execution of | |
| # all the code checks. | |
| # Everything should be merged through PRs anyway. | |
| branches: | |
| - develop | |
| - develop-1.9 | |
| - test-ci-* | |
| - pypi/publish | |
| paths: | |
| - "**" | |
| - "!notebooks/**" | |
| - "!docs/**" | |
| - "!old/**" | |
| - "!README.md" | |
| # 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: | |
| build-wheels: | |
| timeout-minutes: 15 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Setup Python | |
| uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 | |
| with: | |
| python-version: 3.12 | |
| - uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 | |
| id: wheels_cache | |
| with: | |
| path: ./wheels | |
| key: wheels-${{ github.sha }} | |
| - name: Install Dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install --upgrade setuptools | |
| python -m pip install --upgrade \ | |
| build \ | |
| toml \ | |
| wheel \ | |
| packaging \ | |
| twine | |
| python -m pip freeze | |
| - name: Build Clean Packages | |
| run: | | |
| mkdir -p ./wheels/clean | |
| ./scripts/build-wheels.sh ./wheels/clean | |
| find ./wheels/clean -type f | |
| - name: Patch Package Versions | |
| run: | | |
| grep -R --files-with-matches --include '*.py' '__version__ =' \ | |
| | xargs python ./scripts/patch_version.py ${GITHUB_RUN_NUMBER:-0} | |
| - name: Build Dev Packages | |
| run: | | |
| mkdir -p ./wheels/dev | |
| ./scripts/build-wheels.sh ./wheels/dev | |
| find ./wheels/dev -type f | |
| test-with-coverage: | |
| timeout-minutes: 15 | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| services: | |
| # Label used to access the service container | |
| postgres: | |
| # Docker Hub image | |
| image: postgres | |
| # Provide the password for postgres | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: datacube | |
| # Set health checks to wait until postgres has started | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| # Maps tcp port 5432 on service container to the host | |
| - 5432:5432 | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6 | |
| - name: Install in Edit mode | |
| shell: bash | |
| run: | | |
| ./scripts/dev-install.sh --extra tests | |
| - name: Setup Test DB | |
| shell: bash | |
| run: | | |
| echo "Launching test db" | |
| uv run datacube --version | |
| uv run datacube system init | |
| uv pip list --format=freeze | |
| env: | |
| ODC_DEFAULT_DB_URL: postgresql://postgres:postgres@localhost/datacube | |
| - name: Run Tests | |
| shell: bash | |
| run: | | |
| uv run datacube system check | |
| echo "Running Tests" | |
| uv run pytest --cov=. \ | |
| --cov-report=html \ | |
| --cov-report=xml:coverage.xml \ | |
| --timeout=90 \ | |
| libs apps | |
| env: | |
| AWS_DEFAULT_REGION: us-west-2 | |
| DASK_TEMPORARY_DIRECTORY: /tmp/dask | |
| ODC_DEFAULT_DB_URL: postgresql://postgres:postgres@localhost/datacube | |
| - name: Upload Coverage | |
| if: | | |
| github.repository == 'opendatacube/odc-tools' | |
| uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 | |
| with: | |
| use_oidc: true | |
| fail_ci_if_error: false | |
| verbose: false | |
| test-wheels: | |
| timeout-minutes: 15 | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build-wheels | |
| services: | |
| # Label used to access the service container | |
| postgres: | |
| # Docker Hub image | |
| image: postgres | |
| # Provide the password for postgres | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: datacube | |
| # Set health checks to wait until postgres has started | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| # Maps tcp port 5432 on service container to the host | |
| - 5432:5432 | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Get Wheels from Cache | |
| uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 | |
| id: wheels_cache | |
| with: | |
| path: ./wheels | |
| key: wheels-${{ github.sha }} | |
| - name: Install wheels for testing | |
| shell: bash | |
| run: | | |
| which python | |
| ls -lh wheels/clean | |
| python -m pip install psycopg2 | |
| python -m pip install wheels/clean/*whl | |
| python -m pip check || true | |
| - name: Start Test DB | |
| shell: bash | |
| run: | | |
| echo "Launching test db" | |
| datacube system init | |
| env: | |
| ODC_DEFAULT_DB_URL: postgresql://postgres:postgres@localhost/datacube | |
| - name: Run Tests | |
| shell: bash | |
| run: | | |
| datacube system check | |
| # from "https://raw.githubusercontent.com/GeoscienceAustralia/dea-config/master/product_metadata/eo3_sentinel_ard.odc-type.yaml" | |
| datacube metadata add apps/dc_tools/tests/data/eo3_sentinel_ard.odc-type.yaml | |
| python -m pip install deepdiff docker flask flask_cors moto pytest \ | |
| pytest-cov pytest-httpserver pytest-timeout | |
| echo "Running Tests" | |
| pytest --timeout=90 libs apps | |
| env: | |
| AWS_DEFAULT_REGION: us-west-2 | |
| DASK_TEMPORARY_DIRECTORY: /tmp/dask | |
| ODC_DEFAULT_DB_URL: postgresql://postgres:postgres@localhost/datacube | |
| publish-pypi: | |
| if: | | |
| github.event_name == 'push' | |
| && github.repository == 'opendatacube/odc-tools' | |
| && (github.ref == 'refs/heads/stable' || github.ref == 'refs/heads/pypi/publish') | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| pkg: | |
| - odc-cloud | |
| - odc-io | |
| - odc-ui | |
| - odc-apps-dc-tools | |
| needs: | |
| - build-wheels | |
| - test-wheels | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Config | |
| if: | | |
| github.event_name == 'push' | |
| && github.repository == 'opendatacube/odc-tools' | |
| && (github.ref == 'refs/heads/stable' || github.ref == 'refs/heads/pypi/publish') | |
| id: cfg | |
| env: | |
| PKG: ${{ matrix.pkg }} | |
| run: | | |
| tk="pypi_token_${PKG//-/_}" | |
| echo "tk=${tk}" >> $GITHUB_OUTPUT | |
| echo "publish=yes" >> $GITHUB_OUTPUT | |
| - name: Setup Python | |
| if: steps.cfg.outputs.publish == 'yes' | |
| uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 | |
| with: | |
| python-version: "3.12" | |
| - name: Install Twine | |
| if: steps.cfg.outputs.publish == 'yes' | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install --upgrade setuptools | |
| python -m pip install --upgrade \ | |
| toml \ | |
| wheel \ | |
| twine | |
| python -m pip freeze | |
| - uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 | |
| id: wheels_cache | |
| if: steps.cfg.outputs.publish == 'yes' | |
| with: | |
| path: ./wheels | |
| key: wheels-${{ github.sha }} | |
| - name: Prepare for upload | |
| if: steps.cfg.outputs.publish == 'yes' | |
| run: | | |
| mkdir -p ./pips | |
| ./scripts/mk-pip-tree.sh ./wheels/clean ./pips | |
| find ./pips -type f | |
| - name: Upload to PyPI | |
| if: steps.cfg.outputs.publish == 'yes' | |
| env: | |
| TWINE_PASSWORD: ${{ secrets[ steps.cfg.outputs.tk ] }} | |
| TWINE_USERNAME: __token__ | |
| PKG: ${{ matrix.pkg }} | |
| run: | | |
| ls pips/${PKG} | |
| twine upload --non-interactive --skip-existing pips/${PKG}/* |