Verified Commit 042c15b5 authored by Adrian DC's avatar Adrian DC
Browse files

ci(gitlab-ci): isolate 'typings' job to 'typings.yml' template

Signed-off-by: default avatarAdrian DC <radian.dc@gmail.com>
parent 31021685
Loading
Loading
Loading
Loading
Loading
+34 −0
Changes for .gitlab-ci.d/typings.yml: 34 added lines, 0 removed lines.
Original line number Diff line number Diff line
spec:
  inputs:
    stage:
      default: test
      description: 'Defines the typings stage (Default: test)'
    image:
      default: undefined:latest
      description: 'Specify the typings image (Default: undefined:latest)'
---

typings:
  stage: $[[ inputs.stage ]]
  image: $[[ inputs.image ]]
  variables:
    MYPY_CACHE_DIR: /dev/null
    MYPY_FORCE_COLOR: 1
    TERM: ansi
  script:
    - set +x
    - |
      if [ $(git rev-list --count HEAD) -gt 1 ]; then
        if ls ./docs/*.py >/dev/null 2>&1; then
          mypy --follow-imports silent --pretty $(git diff --name-only $(git diff --exit-code >/dev/null && echo 'HEAD~1' || echo 'HEAD') ./docs/ ./src/ ./setup.py | grep '\.py$') 2>/dev/null || true
        else
          mypy --follow-imports silent --pretty $(git diff --name-only $(git diff --exit-code >/dev/null && echo 'HEAD~1' || echo 'HEAD') ./src/ ./setup.py | grep '\.py$') 2>/dev/null || true
        fi
      fi
    - sleep 1
    - |
      if ls ./docs/*.py >/dev/null 2>&1; then
        mypy --follow-imports silent --pretty ./docs/ ./src/ ./setup.py
      else
        mypy --follow-imports silent --pretty ./src/ ./setup.py
      fi
+4 −14
Changes for .gitlab-ci.yml: 4 added lines, 14 removed lines.
Original line number Diff line number Diff line
@@ -16,6 +16,10 @@ include:
    inputs:
      stage: prepare
      image: registry.gitlab.com/radiandevcore/tools/gcil/gcil:codestyle
  - local: .gitlab-ci.d/typings.yml
    inputs:
      stage: prepare
      image: registry.gitlab.com/radiandevcore/tools/gcil/gcil:codestyle
  - local: .gitlab-ci.d/build.yml
    inputs:
      stage: build
@@ -326,24 +330,10 @@ lint:
      when: on_success

typings:
  stage: prepare
  image: registry.gitlab.com/radiandevcore/tools/gcil/gcil:codestyle
  needs:
    - job: registry:codestyle
      artifacts: false
      optional: true
  variables:
    MYPY_CACHE_DIR: /dev/null
    MYPY_FORCE_COLOR: 1
    TERM: ansi
  script:
    - set +x
    - |
      if [ $(git rev-list --count HEAD) -gt 1 ]; then
        mypy --follow-imports silent --pretty $(git diff --name-only $(git diff --exit-code >/dev/null && echo 'HEAD~1' || echo 'HEAD') ./docs/ ./src/ ./setup.py | grep '\.py$') 2>/dev/null || true
      fi
    - sleep 1
    - mypy --follow-imports silent --pretty ./docs/ ./src/ ./setup.py
  rules:
    - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
      changes: