2020-01-11 12:02:47 +00:00
|
|
|
stages:
|
|
|
|
- build
|
|
|
|
- test
|
|
|
|
- report
|
2019-11-30 05:54:01 +00:00
|
|
|
|
2020-01-11 12:02:47 +00:00
|
|
|
default:
|
2021-07-02 13:49:57 +00:00
|
|
|
image:
|
2022-07-11 03:26:07 +00:00
|
|
|
name: registry.gitlab.com/kicad/kicad-ci/source_containers/master/fedora:36
|
2021-07-02 13:49:57 +00:00
|
|
|
entrypoint: ["/bin/sh", "-c"]
|
2020-01-11 12:02:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
##########################################################################
|
|
|
|
# Test the formatting in a merge request using clang-format
|
|
|
|
##########################################################################
|
2019-12-03 14:58:51 +00:00
|
|
|
# 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
|
2019-11-30 05:54:01 +00:00
|
|
|
test_formatting:
|
|
|
|
stage: test
|
2020-07-31 17:42:00 +00:00
|
|
|
needs: []
|
2020-01-11 12:02:47 +00:00
|
|
|
only:
|
|
|
|
- merge_requests
|
2019-12-04 20:10:23 +00:00
|
|
|
allow_failure: true
|
2020-01-11 12:02:47 +00:00
|
|
|
before_script:
|
|
|
|
# We must manually add the KiCad remote to ensure it is named sensibly
|
|
|
|
- git remote add product https://gitlab.com/kicad/code/kicad.git
|
2020-07-31 17:42:00 +00:00
|
|
|
- git remote add source ${CI_MERGE_REQUEST_SOURCE_PROJECT_URL}.git
|
2020-01-11 12:02:47 +00:00
|
|
|
- git fetch -n product
|
2020-07-31 17:42:00 +00:00
|
|
|
- git fetch -n source
|
2020-01-11 12:02:47 +00:00
|
|
|
# Get the SHAs of the commits
|
|
|
|
- "TARGET_HEAD_SHA=$(git rev-parse product/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME})"
|
2020-07-31 17:42:00 +00:00
|
|
|
- "SOURCE_HEAD_SHA=$(git rev-parse source/${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME})"
|
2020-01-11 12:02:47 +00:00
|
|
|
- "MERGE_BASE_SHA=$(git merge-base ${TARGET_HEAD_SHA} ${SOURCE_HEAD_SHA})"
|
2019-12-03 14:58:51 +00:00
|
|
|
script:
|
2019-12-03 18:51:59 +00:00
|
|
|
- echo "Testing formatting from commit ${MERGE_BASE_SHA}"
|
|
|
|
- ./tools/check_coding.sh --diff --ci --commit ${MERGE_BASE_SHA}
|
2020-01-11 12:02:47 +00:00
|
|
|
|
|
|
|
|
2020-07-17 18:42:14 +00:00
|
|
|
include:
|
|
|
|
- local: '/.gitlab/templates.yml'
|
2021-04-01 00:15:54 +00:00
|
|
|
- local: '/.gitlab/Fedora-Linux-CI.yml'
|
|
|
|
- local: '/.gitlab/Ubuntu-20.04-CI.yml'
|
2022-12-03 13:17:03 +00:00
|
|
|
- local: '/.gitlab/Windows-CI.yml'
|
2020-07-17 18:42:14 +00:00
|
|
|
- local: '/.gitlab/coverity.yml'
|
2021-03-21 14:26:05 +00:00
|
|
|
- local: '/.gitlab/linux-metadata-validate.yml'
|
2022-07-10 18:41:45 +00:00
|
|
|
- local: '/.gitlab/doxygen.yml'
|