Commit 7830d912 authored by sagnowski's avatar sagnowski
Browse files

Expose patch with formatting fix as artifact of clang-format job

parent 8671fbd9
Loading
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -404,11 +404,21 @@ clang-format-check:
  extends:
    - .test-job-linux
    - .rules-merge-request
  variables:
    ARTIFACT_NAME: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--formatting-fix.patch"
  stage: validate
  needs: []
  timeout: "5 minutes"
  script:
    - scripts/check-format.sh -a -p 8
    - format_problems=$(scripts/check-format.sh -af -p 8)
    - if [ $format_problems == 0 ] then; exit 0; fi
    - git diff > formatting-fix.patch
  artifacts:
    paths:
      - formatting-fix.patch
    when: on_failure
    name: $ARTIFACT_NAME
    expose_as: 'formatting patch'

# ---------------------------------------------------------------
# Test jobs for main branch