-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
1,184 additions
and
301 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Docker (test runner) | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'docker/**' | ||
- '.github/workflows/docker-test-runner.yml' | ||
- 'setup.py' | ||
|
||
env: | ||
ORG: opendatacube | ||
IMAGE: datacube-tests | ||
BUILDER_TAG: _build_cache | ||
DOCKER_USER: gadockersvc | ||
|
||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: '3.6' | ||
|
||
# This is just to get dependencies right, we do not keep datacube in the final image | ||
- name: Build datacube source distribution | ||
run: | | ||
mkdir -p ./docker/dist/ | ||
find ./docker/dist/ -type f -delete | ||
python setup.py sdist --dist-dir ./docker/dist/ | ||
ls -lh ./docker/dist/ | ||
- name: Pull docker cache | ||
run: | | ||
docker pull ${ORG}/${IMAGE}:latest || true | ||
docker pull ${ORG}/${IMAGE}:${BUILDER_TAG} || true | ||
- name: Build Test Runner Docker | ||
run: | | ||
# build and cache first stage (env_builder) | ||
docker build \ | ||
--target env_builder \ | ||
--cache-from ${ORG}/${IMAGE}:${BUILDER_TAG} \ | ||
--tag ${ORG}/${IMAGE}:${BUILDER_TAG} \ | ||
./docker/ | ||
# now build second stage making sure first stage is from cache | ||
docker build \ | ||
--cache-from ${ORG}/${IMAGE}:${BUILDER_TAG} \ | ||
--cache-from ${ORG}/${IMAGE}:latest \ | ||
--tag ${ORG}/${IMAGE}:latest \ | ||
./docker/ | ||
- name: DockerHub Push | ||
if: | | ||
github.ref == 'refs/heads/master' || | ||
github.ref == 'refs/heads/kk-gh-actions' | ||
run: | | ||
echo "Login to DockerHub as ${DOCKER_USER}" | ||
echo "${{ secrets.DockerPassword }}" | docker login -u "${DOCKER_USER}" --password-stdin | ||
docker push ${ORG}/${IMAGE}:${BUILDER_TAG} | ||
docker push ${ORG}/${IMAGE}:latest |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
name: build | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- '**' | ||
|
||
push: | ||
paths: | ||
- '**' | ||
- '!.github/**' | ||
- '.github/workflows/main.yml' | ||
- '!docker/**' | ||
- '!examples/**' | ||
- '!docs/**' | ||
- '!contrib/**' | ||
|
||
env: | ||
DKR: opendatacube/datacube-tests:latest | ||
|
||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Pull Docker | ||
run: | | ||
docker pull ${DKR} | ||
- name: Check Code Style | ||
run: | | ||
docker run --rm \ | ||
-v $(pwd):/src/datacube-core \ | ||
-e SKIP_DB=yes \ | ||
${DKR} \ | ||
pycodestyle tests integration_tests examples utils --max-line-length 120 | ||
- name: Lint Code | ||
run: | | ||
docker run --rm \ | ||
-v $(pwd):/src/datacube-core \ | ||
-e SKIP_DB=yes \ | ||
${DKR} \ | ||
pylint -j 2 --reports no datacube datacube_apps | ||
- name: Run Tests | ||
run: | | ||
docker run --rm \ | ||
-v $(pwd):/src/datacube-core \ | ||
${DKR} \ | ||
pytest -r a \ | ||
--cov datacube \ | ||
--cov-report=xml \ | ||
--doctest-ignore-import-errors \ | ||
--durations=5 \ | ||
datacube \ | ||
tests \ | ||
datacube_apps \ | ||
integration_tests | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CodeCovToken }} | ||
file: ./coverage.xml | ||
fail_ci_if_error: true | ||
|
||
- name: Build Packages | ||
run: | | ||
docker run --rm \ | ||
-v $(pwd):/src/datacube-core \ | ||
-e SKIP_DB=yes \ | ||
${DKR} \ | ||
python setup.py bdist_wheel sdist | ||
ls -lh ./dist/ | ||
- name: Publish to dea packages repo | ||
if: | | ||
github.ref == 'refs/heads/develop' | ||
&& github.event_name == 'push' | ||
run: | | ||
echo "Using Keys: ...${AWS_ACCESS_KEY_ID:(-4)}/...${AWS_SECRET_ACCESS_KEY:(-4)}" | ||
aws s3 ls ${S3_DST} | ||
aws s3 cp ./dist/datacube-*whl "${S3_DST}/" | ||
aws s3 cp ./dist/datacube-*tar.gz "${S3_DST}/" | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
S3_DST: 's3://datacube-core-deployment/datacube/' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,6 @@ env: | |
|
||
language: python | ||
python: | ||
- "3.5" | ||
- "3.6" | ||
|
||
cache: | ||
|
This file was deleted.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
if __name__ == "__main__": | ||
from .config import auto_config | ||
auto_config() |
Oops, something went wrong.