Skip to content
Snippets Groups Projects
Commit 95243619 authored by Lars Bilke's avatar Lars Bilke
Browse files

Merge branch 'ci-needs' into 'master'

[ci] Fix pre-commit jobs on fork pipelines.

See merge request ogs/ogs!3750
parents 93d45525 85b25459
No related branches found
No related tags found
No related merge requests found
...@@ -3,10 +3,7 @@ code coverage: ...@@ -3,10 +3,7 @@ code coverage:
extends: extends:
- .template-build-linux - .template-build-linux
tags: [shell, envinf] tags: [shell, envinf]
needs: needs: [meta]
- job: "build linux: [USE_PYTHON=OFF]"
artifacts: false
- meta
variables: variables:
CMAKE_PRESET: coverage CMAKE_PRESET: coverage
TARGETS: "testrunner_coverage ctest_coverage" TARGETS: "testrunner_coverage ctest_coverage"
......
meta: meta:
stage: .pre stage: preparation
tags: [shell] tags: [shell]
needs: []
variables: variables:
GIT_DEPTH: 1000 GIT_DEPTH: 1000
script: script:
......
pre commit: pre commit:
stage: preparation stage: preparation
image: $PRECOMMIT_IMAGE image: $PRECOMMIT_IMAGE
rules:
- if: $CI_MERGE_REQUEST_IID
needs: [ci_images] needs: [ci_images]
variables: variables:
SKIP: clang-format SKIP: clang-format
script: script:
- pre-commit install - pre-commit install
- pre-commit run --from-ref `git merge-base origin/master HEAD` --to-ref HEAD - TARGET_SHA1=$(git show-ref -s ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME})
- git diff --check `git merge-base origin/master HEAD` HEAD -- . ':!*.md' ':!*.pandoc' ':!*.asc' ':!*.dat' ':!*.ts' - pre-commit run --from-ref `git merge-base ${TARGET_SHA1} HEAD` --to-ref HEAD
- echo "Target branch is ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}, target sha is ${TARGET_SHA1}."
- git diff --check `git merge-base ${TARGET_SHA1} HEAD` HEAD -- . ':!*.md' ':!*.pandoc' ':!*.asc' ':!*.dat' ':!*.ts'
clang-format: clang-format:
stage: check stage: check
image: $PRECOMMIT_IMAGE image: $PRECOMMIT_IMAGE
rules:
- if: $CI_MERGE_REQUEST_IID
needs: [ci_images] needs: [ci_images]
allow_failure: true allow_failure: true
script: script:
- pre-commit install - pre-commit install
- pre-commit run clang-format --from-ref `git merge-base origin/master HEAD` --to-ref HEAD - TARGET_SHA1=$(git show-ref -s ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME})
- pre-commit run clang-format --from-ref `git merge-base ${TARGET_SHA1} HEAD` --to-ref HEAD
after_script: after_script:
- git diff - git diff
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment