update test requirements.txt #667
Workflow file for this run
This file contains 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: | |
push: | |
branches-ignore: [develop] | |
paths: | |
- '**' | |
- '!docker/**' | |
- '!.github/workflows/statistician-*' | |
- '!notebooks/**' | |
- '!docs/**' | |
- '!k8s/**' | |
- '!README.md' | |
workflow_run: | |
workflows: ["Create a new tag"] | |
types: | |
- completed | |
jobs: | |
build-wheels: | |
if: | | |
github.event_name == 'push' || (github.ref == 'refs/heads/develop' | |
&& github.event.workflow_run.conclusion == 'success') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/cache@v3 | |
id: wheels_cache | |
with: | |
path: ./wheels | |
key: wheels-${{ github.sha }} | |
- name: Setup Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.8 | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --upgrade \ | |
setuptools \ | |
setuptools-scm | |
python -m pip install --upgrade \ | |
toml \ | |
wheel \ | |
twine \ | |
packaging | |
python -m pip freeze | |
- name: Build Clean Packages | |
run: | | |
mkdir -p ./wheels/clean | |
python setup.py bdist_wheel --dist-dir ./wheels/clean/ | |
python setup.py sdist --dist-dir ./wheels/clean/ | |
find ./wheels/clean -type f | |
test-wheels: | |
runs-on: ubuntu-latest | |
container: | |
image: opendatacube/datacube-statistician:latest | |
services: | |
postgres: | |
image: postgis/postgis:10-2.5 | |
env: | |
POSTGRES_DB: opendatacube | |
POSTGRES_PASSWORD: opendatacubepassword | |
POSTGRES_USER: opendatacube | |
needs: | |
- build-wheels | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Dependencies | |
shell: bash | |
run: | | |
apt update | |
DEBIAN_FRONTEND=noninteractive apt-get install -y \ | |
--fix-missing --no-install-recommends \ | |
nodejs \ | |
zstd | |
python -m pip install --upgrade --no-cache pip | |
pip install --upgrade --no-cache -r \ | |
tests/requirements.txt | |
pip freeze | |
- name: Get Wheels from Cache | |
uses: actions/cache@v3 | |
id: wheels_cache | |
with: | |
path: ./wheels | |
key: wheels-${{ github.sha }} | |
- name: Install wheels for testing | |
shell: bash | |
run: | | |
which python | |
which datacube | |
ls -lh wheels/clean | |
pip install --no-deps --no-cache wheels/clean/*whl | |
pip check || true | |
pip show odc-stats | |
which odc-stats | xargs ls -alt | |
odc-stats --version | |
- name: Run Tests | |
shell: bash | |
run: | | |
echo "Init DB" | |
./tests/init_db.sh | |
echo "Running unit tests" | |
pytest --cov=. \ | |
--cov-report=html \ | |
--cov-report=xml:coverage.xml \ | |
--timeout=30 tests | |
echo "Running integration tests" | |
./tests/integration_test.sh | |
env: | |
DB_HOSTNAME: postgres | |
DB_USERNAME: opendatacube | |
DB_PASSWORD: opendatacubepassword | |
DB_DATABASE: opendatacube | |
AWS_NO_SIGN_REQUEST: true | |
AWS_DEFAULT_REGION: ap-southeast-2 | |
AWS_REGION: ap-southeast-2 | |
STAC_API_URL: https://earth-search.aws.element84.com/v0/ | |
GDAL_HTTP_MAX_RETRY: 5 | |
- name: Upload Coverage | |
if: | | |
github.repository == 'opendatacube/odc-stats' | |
uses: codecov/codecov-action@v3 | |
with: | |
fail_ci_if_error: false | |
verbose: false |