WIP: aux band support #1218
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: Run Code Checks | |
on: | |
pull_request: | |
push: | |
# 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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Setup Python | |
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
with: | |
python-version: "3.10" | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade flit twine | |
python -m pip freeze | |
- name: Build Clean Packages | |
run: | | |
mkdir -p ./wheels/clean | |
flit build --format wheel --format sdist | |
mv dist/* ./wheels/clean/ | |
find ./wheels/clean -type f | |
- name: Check Packaging | |
run: | | |
find ./wheels/clean -type f | xargs twine check | |
- name: Upload wheels as artifacts | |
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
with: | |
name: python-wheels | |
path: ./wheels/clean/ | |
retention-days: 1 | |
build-test-env-base: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
id: conda_cache | |
with: | |
path: /tmp/test_env | |
key: ${{ runner.os }}-test-env-py310-${{ hashFiles('tests/test-env-py310.yml', 'pyproject.toml') }} | |
- uses: conda-incubator/setup-miniconda@835234971496cad1653abb28a638a281cf32541f # v3.2.0 | |
if: steps.conda_cache.outputs.cache-hit != 'true' | |
with: | |
miniforge-variant: Miniforge3 | |
miniforge-version: latest | |
use-mamba: true | |
- name: Dump Conda Environment Info | |
shell: bash -l {0} | |
if: steps.conda_cache.outputs.cache-hit != 'true' | |
run: | | |
conda info | |
conda list | |
conda config --show-sources | |
conda config --show | |
printenv | sort | |
- name: Build Python Environment for Testing | |
shell: bash -l {0} | |
if: steps.conda_cache.outputs.cache-hit != 'true' | |
run: | | |
mamba env create -f tests/test-env-py310.yml -p /tmp/test_env | |
- name: Install odc-loader | |
shell: bash -l {0} | |
if: steps.conda_cache.outputs.cache-hit != 'true' | |
run: | | |
/tmp/test_env/bin/python -m pip install odc-loader==0.6.0rc3 | |
- name: Check Python Env | |
shell: bash -l {0} | |
if: steps.conda_cache.outputs.cache-hit != 'true' | |
run: | | |
mamba env export -p /tmp/test_env | |
build-binder-env: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
id: binder_cache | |
with: | |
path: /tmp/binder_env | |
key: ${{ runner.os }}-binder-env-${{ hashFiles('binder/environment.yml') }} | |
- uses: conda-incubator/setup-miniconda@835234971496cad1653abb28a638a281cf32541f # v3.2.0 | |
if: steps.binder_cache.outputs.cache-hit != 'true' | |
with: | |
miniforge-variant: Miniforge3 | |
miniforge-version: latest | |
use-mamba: true | |
- name: Dump Conda Environment Info | |
shell: bash -l {0} | |
if: steps.binder_cache.outputs.cache-hit != 'true' | |
run: | | |
conda info | |
conda list | |
conda config --show-sources | |
conda config --show | |
printenv | sort | |
- name: Build Python Environment for Notebooks | |
shell: bash -l {0} | |
if: steps.binder_cache.outputs.cache-hit != 'true' | |
run: | | |
cd binder | |
mamba env create -f environment.yml -p /tmp/binder_env | |
- name: Check Python Env | |
shell: bash -l {0} | |
if: steps.binder_cache.outputs.cache-hit != 'true' | |
run: | | |
mamba env export -p /tmp/binder_env | |
run-black-check: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
needs: | |
- build-test-env-base | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Get Conda Environment from Cache | |
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
id: conda_cache | |
with: | |
path: /tmp/test_env | |
key: ${{ runner.os }}-test-env-py310-${{ hashFiles('tests/test-env-py310.yml', 'pyproject.toml') }} | |
- name: Update PATH | |
shell: bash | |
run: | | |
echo "/tmp/test_env/bin" >> $GITHUB_PATH | |
- name: Check formatting (black) | |
shell: bash | |
run: | | |
black --version | |
black --check --diff . | |
run-pylint: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
needs: | |
- build-test-env-base | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Get Conda Environment from Cache | |
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
id: conda_cache | |
with: | |
path: /tmp/test_env | |
key: ${{ runner.os }}-test-env-py310-${{ hashFiles('tests/test-env-py310.yml', 'pyproject.toml') }} | |
- name: Update PATH | |
shell: bash | |
run: | | |
echo "/tmp/test_env/bin" >> $GITHUB_PATH | |
- name: Install in Edit mode | |
shell: bash | |
run: | | |
pip install -e . | |
- name: Check with pylint | |
shell: bash | |
run: | | |
echo "Running pylint" | |
pylint --version | |
echo "-------------------------------------" | |
pylint -v odc | |
run-mypy: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
needs: | |
- build-test-env-base | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Get Conda Environment from Cache | |
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
id: conda_cache | |
with: | |
path: /tmp/test_env | |
key: ${{ runner.os }}-test-env-py310-${{ hashFiles('tests/test-env-py310.yml', 'pyproject.toml') }} | |
- name: Update PATH | |
shell: bash | |
run: | | |
echo "/tmp/test_env/bin" >> $GITHUB_PATH | |
- name: Install in Edit mode | |
shell: bash | |
run: | | |
pip install -e . | |
- name: Check with mypy | |
shell: bash | |
run: | | |
python -m mypy --namespace-packages --explicit-package-bases odc | |
test-with-coverage: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
needs: | |
- build-test-env-base | |
- run-black-check | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Get Conda Environment from Cache | |
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
id: conda_cache | |
with: | |
path: /tmp/test_env | |
key: ${{ runner.os }}-test-env-py310-${{ hashFiles('tests/test-env-py310.yml', 'pyproject.toml') }} | |
- name: Update PATH | |
shell: bash | |
run: | | |
echo "/tmp/test_env/bin" >> $GITHUB_PATH | |
- name: Install in Edit mode | |
shell: bash | |
run: | | |
pip install -e '.[botocore]' | |
- name: Run Tests | |
shell: bash | |
run: | | |
echo "Running Tests" | |
pytest --cov=. \ | |
--cov-report=html \ | |
--cov-report=xml:coverage.xml \ | |
--timeout=30 \ | |
tests odc | |
env: | |
AWS_DEFAULT_REGION: us-west-2 | |
DASK_TEMPORARY_DIRECTORY: /tmp/dask | |
- name: Upload Coverage | |
if: | | |
github.repository == 'opendatacube/odc-stac' | |
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3 | |
with: | |
fail_ci_if_error: false | |
verbose: false | |
use_oidc: true | |
test-wheels: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
needs: | |
- build-test-env-base | |
- run-black-check | |
- build-wheels | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Download wheels from artifacts | |
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 | |
with: | |
name: python-wheels | |
path: ./wheels/clean | |
- name: Get Conda Environment from Cache | |
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
id: conda_cache | |
with: | |
path: /tmp/test_env | |
key: ${{ runner.os }}-test-env-py310-${{ hashFiles('tests/test-env-py310.yml', 'pyproject.toml') }} | |
- name: Update PATH | |
shell: bash | |
run: | | |
echo "/tmp/test_env/bin" >> $GITHUB_PATH | |
- name: Install wheels for testing | |
shell: bash | |
run: | | |
which python | |
ls -lh wheels/clean | |
python -m pip install --no-deps wheels/clean/*whl | |
python -m pip check || true | |
- name: Run Tests | |
shell: bash | |
run: | | |
echo "Running Tests" | |
pytest --timeout=30 tests odc | |
env: | |
AWS_DEFAULT_REGION: us-west-2 | |
DASK_TEMPORARY_DIRECTORY: /tmp/dask | |
build-notebooks: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
needs: | |
- build-binder-env | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
id: nb_cache | |
with: | |
path: docs/notebooks | |
key: docs-notebooks-${{ hashFiles('notebooks/*.py') }} | |
- name: Get Conda Environment from Cache | |
if: steps.nb_cache.outputs.cache-hit != 'true' | |
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
id: conda_cache | |
with: | |
path: /tmp/binder_env | |
key: ${{ runner.os }}-binder-env-${{ hashFiles('binder/environment.yml') }} | |
- name: Update PATH | |
if: steps.nb_cache.outputs.cache-hit != 'true' | |
shell: bash | |
run: | | |
echo "/tmp/binder_env/bin" >> $GITHUB_PATH | |
- name: Run Notebooks | |
if: steps.nb_cache.outputs.cache-hit != 'true' | |
run: | | |
nb_dir=docs/notebooks | |
mkdir -p $nb_dir | |
for src in $(find notebooks -type f -maxdepth 1 -name '*py'); do | |
dst="$nb_dir/$(basename ${src%%.py}.ipynb)" | |
echo "$src -> $dst" | |
./binder/render-nb-pipe.sh <$src >$dst | |
done | |
ls -lh $nb_dir | |
check-docs: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
needs: | |
- build-test-env-base | |
- run-black-check | |
- build-notebooks | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Get Rendered Notebooks | |
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
id: nb_cache | |
with: | |
path: docs/notebooks | |
key: docs-notebooks-${{ hashFiles('notebooks/*.py') }} | |
- name: Get Conda Environment from Cache | |
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
id: conda_cache | |
with: | |
path: /tmp/test_env | |
key: ${{ runner.os }}-test-env-py310-${{ hashFiles('tests/test-env-py310.yml', 'pyproject.toml') }} | |
- name: Update PATH | |
shell: bash | |
run: | | |
echo "/tmp/test_env/bin" >> $GITHUB_PATH | |
- name: Config | |
id: cfg | |
run: | | |
find notebooks/ -maxdepth 1 -name '*.py' -type f | sort -f -d | |
nb_dir="docs/notebooks" | |
nb_hash=$(python scripts/notebook_hash.py) | |
echo "Notebooks hash: ${nb_hash}" | |
echo "nb-hash=${nb_hash}" >> $GITHUB_OUTPUT | |
echo "nb-hash-short=${nb_hash:0:16}" >> $GITHUB_OUTPUT | |
- name: Install in Edit mode | |
shell: bash | |
run: | | |
pip install -e . --no-deps | |
- name: Build STAC docs | |
shell: bash | |
run: | | |
make -C docs html | |
- name: Deploy to Netlify | |
id: netlify | |
if: github.event_name == 'pull_request' | |
uses: nwtgck/actions-netlify@4cbaf4c08f1a7bfa537d6113472ef4424e4eb654 # v3.0.0 | |
with: | |
production-branch: "develop" | |
publish-dir: "docs/_build/html" | |
deploy-message: "Deploy from GitHub Actions" | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
enable-pull-request-comment: true | |
enable-commit-comment: false | |
alias: ${{ steps.cfg.outputs.nb-hash-short }} | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
- name: Print Notice | |
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | |
if: github.event_name == 'pull_request' | |
env: | |
NETLIFY_URL: ${{ steps.netlify.outputs.deploy-url }} | |
with: | |
script: | | |
const {NETLIFY_URL} = process.env | |
core.notice(`Published to: ${NETLIFY_URL}`) |