This repository has been archived by the owner on Feb 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
99 lines (89 loc) · 2.12 KB
/
.gitlab-ci.yml
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# GitLab CI configuration
#
# SPDX-FileCopyrightText: 2017 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
variables:
GIT_SUBMODULE_STRATEGY: recursive
PREFIX: /usr/
DOCKER_TAG: ${CI_COMMIT_REF_NAME}
DOCKER_IMAGE_DEV: villas/fpga-dev
stages:
- prepare
- build
- test
# Stage: prepare
# Build docker image which is used to build & test VILLASnode
docker-dev:
stage: prepare
script:
- docker build -t ${DOCKER_IMAGE_DEV}:${DOCKER_TAG} .
tags:
- docker
# Stage: build
build:source:
stage: build
script:
- mkdir build && cd build && cmake3 .. && make -j8
artifacts:
expire_in: 1 week
name: ${CI_PROJECT_NAME}-${CI_BUILD_REF}
paths:
- build/
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
tags:
- docker
# Stage: test
test:unit:
stage: test
tags:
- docker
allow_failure: true
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
script: |
rm -r build && mkdir build && cd build
cmake ..
make -j$(nproc) unit-tests-fpga
if [ "$(who | wc -l)" -eq "0" ]; then
tests/unit/unit-tests-fpga --jobs 1 --filter 'fpga/*'
else
echo "System is currently used by: $(who)"
echo "We are skipping the test. Please restart manually."
fi
test:cppcheck:
stage: test
script:
- cppcheck -j $(nproc)
--max-configs=32
--error-exitcode=1
--quiet
--inline-suppr
--enable=warning,performance,portability,information,missingInclude
--std=c++11
--suppress=noValidConfiguration
-I include
-I common/include
gpu/
src/
lib/
tests/unit/
--suppress=unmatchedSuppression
-igpu/thirdparty | tee cppcheck.log
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
dependencies:
- build:source
tags:
- docker
artifacts:
when: on_failure
paths:
- cppcheck.log
expose_as: cppcheck
test:reuse:
tags:
- docker
stage: test
image:
name: fsfe/reuse:latest
entrypoint: [""]
script:
- reuse lint