-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy path.gitlab-ci-check-c++.yml
More file actions
43 lines (41 loc) · 1.19 KB
/
.gitlab-ci-check-c++.yml
File metadata and controls
43 lines (41 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# .gitlab-ci-check-c++.yml
#
# This gitlab-ci template performs format checks using clang-format,
#
# Add it to the project in hand through Gitlab's include functionality
#
# include:
# - project: 'Northern.tech/Mender/mendertesting'
# file: '.gitlab-ci-check-c++.yml'
#
# The standard .clang-format from this repository is used unless the
# project including this template has its own version in the root dir.
#
stages:
- test
test:format:
variables:
GIT_SUBMODULE_STRATEGY: recursive
GIT_SUBMODULE_DEPTH: 1
tags:
- k8s-small
stage: test
needs: []
retry:
max: 2
when:
- runner_system_failure
- stuck_or_timeout_failure
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/alpine:3.17
before_script:
# Install compile dependencies
- apk add git curl clang15-extra-tools
# Copy .clang-format
- if [ ! -f .clang-format ]; then
- curl -f
https://raw.githubusercontent.com/mendersoftware/mendertesting/master/.clang-format
--output .clang-format
- fi
script:
- git ls-tree --name-only --full-name -r HEAD | grep -E '\.([ch](pp)?|cc)$' | xargs clang-format -i --style=file:.clang-format
- git diff --exit-code