kicad/.gitlab-ci.yml

46 lines
1.6 KiB
YAML
Raw Normal View History

2020-01-11 12:02:47 +00:00
stages:
- build
- test
- report
2020-01-11 12:02:47 +00:00
default:
image:
name: registry.gitlab.com/kicad/kicad-ci/source_containers/master/fedora:34
entrypoint: ["/bin/sh", "-c"]
2020-01-11 12:02:47 +00:00
##########################################################################
# Test the formatting in a merge request using clang-format
##########################################################################
# 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
needs: []
2020-01-11 12:02:47 +00:00
only:
- merge_requests
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
- git remote add source ${CI_MERGE_REQUEST_SOURCE_PROJECT_URL}.git
2020-01-11 12:02:47 +00:00
- git fetch -n product
- 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})"
- "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})"
script:
- 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
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-01-10 02:25:41 +00:00
- local: '/.gitlab/Windows-CI.yml'
- local: '/.gitlab/coverity.yml'
- local: '/.gitlab/linux-metadata-validate.yml'