Innopolis University DevOps Playground
Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.01 KiB
Newer Older
stages:
  - linting

include:
  - template: Code-Quality.gitlab-ci.yml

workflow:
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
    - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH

code_quality:    
  stage: linting
  artifacts:
    expire_in: 14 days
    paths: [gl-code-quality-report.json]

code_quality_html:
  stage: linting
  extends: code_quality
  variables:
    REPORT_FORMAT: html
  artifacts:
    expire_in: 14 days
    paths: [gl-code-quality-report.html]

ruff:
  stage: linting
  image: registry.gitlab.com/pipeline-components/ruff:latest
  script:
    - ruff --format=gitlab . > gl-code-quality-report.json
  artifacts:
    when: always
    expire_in: 14 days
    paths: [gl-code-quality-report.json]

mypy:
  stage: linting
  image: python:alpine
  script:
    - pip install mypy mypy-gitlab-code-quality
    - mypy . --no-error-summary | mypy-gitlab-code-quality > gl-code-quality-report.json
  artifacts:
    when: always
    expire_in: 14 days
    paths: [gl-code-quality-report.json]