mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
99 lines
2.1 KiB
YAML
99 lines
2.1 KiB
YAML
# 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
|