7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-17 00:19:18 +00:00
kicad/.gitlab-ci.yml
Ian McInerney 4ebb591a5c Allow the formatting test to fail
By allowing to to fail, we won't block the rest
of the CI tests, and also won't block the merge.
2019-12-04 20:10:23 +00:00

23 lines
956 B
YAML

before_script:
- apt-get update -qq -y && apt-get install -y -qq clang-format git
# We must manually add the KiCad remote to ensure it is named sensibly
- git remote add product https://gitlab.com/kicad/code/kicad.git
- git fetch -n product
- git fetch -n origin
# Get the SHAs of the commits
- "TARGET_HEAD_SHA=$(git rev-parse product/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME})"
- "SOURCE_HEAD_SHA=$(git rev-parse origin/${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME})"
- "MERGE_BASE_SHA=$(git merge-base ${TARGET_HEAD_SHA} ${SOURCE_HEAD_SHA})"
# The variable CI_COMMIT_BEFORE_SHA is not available in normal merge requests
# so we must build the commit hash ourselves, see:
# https://gitlab.com/gitlab-org/gitlab/issues/12850
test_formatting:
stage: test
allow_failure: true
script:
- echo "Testing formatting from commit ${MERGE_BASE_SHA}"
- ./tools/check_coding.sh --diff --ci --commit ${MERGE_BASE_SHA}
only:
- merge_requests