diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 273b9eb47b63aaf2d93a3a2867ae3f07ea950231..021e624e73addc0cf5279f39d055e2bbdd0ec0fc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -30,6 +30,23 @@ stages: stage: build image: ${DEVOPS_REGISTRY}usgs/java:11 +.python: + before_script: + - curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python + - . $HOME/.bash_profile + - poetry install + extends: + - .tags::development + image: ${DEVOPS_REGISTRY}usgs/python:3 + rules: + - + changes: + - '*/**.py' + when: on_success + - + allow_failure: true + when: manual + .templates: adjust-ref: &adjust-ref | if [[ \ @@ -82,14 +99,22 @@ stages: # Stage: build #### -Build Project: +Java - Build Project: extends: - .gradle - stage: build + rules: + - + changes: + - '*/**.java' + when: on_success + - + allow_failure: true + when: manual script: - ./gradlew assemble + stage: build -Build Image 2018: +Java - Build Image 2018: extends: - .build before_script: @@ -103,19 +128,48 @@ Build Image 2018: ci_job_token=${CI_JOB_TOKEN} netcdf_file=DATA/data.nc -Unit Tests: - extends: - - .gradle - coverage: '/Total.*?([0-9]{1,3})%/' - stage: build - script: - - ./gradlew --no-daemon check - - cat ${JACOCO_HTML_DIR}/index.html +Java - Unit Tests: artifacts: paths: - ${REPORTS_DIR} reports: junit: ${JUNIT_FILES} + coverage: '/Total.*?([0-9]{1,3})%/' + extends: + - .gradle + rules: + - + changes: + - '*/**.java' + when: on_success + - + allow_failure: true + when: manual + script: + - ./gradlew + - cat ${JACOCO_HTML_DIR}/index.html + stage: build + +Python - Lint: + extends: + - .python + script: + - poetry run lint + stage: build + +Python - Format Check: + extends: + - .python + script: + - poetry run format_check + stage: build + +Python - Download Database: + extends: + - .python + script: + - poetry run database + stage: build #### # Stage: publish