From 7e2365bfa09acb978ca6cf104f5c15885eb4994e Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Mon, 15 Jun 2020 21:55:03 +0200 Subject: [PATCH] ci: update CI config --- fpga/.gitlab-ci.yml | 47 ++++----------------------------------------- fpga/CMakeLists.txt | 2 ++ fpga/Dockerfile | 16 ++++++++++----- 3 files changed, 17 insertions(+), 48 deletions(-) diff --git a/fpga/.gitlab-ci.yml b/fpga/.gitlab-ci.yml index 66deb89c8..c4f754035 100644 --- a/fpga/.gitlab-ci.yml +++ b/fpga/.gitlab-ci.yml @@ -1,19 +1,13 @@ variables: - GIT_STRATEGY: fetch GIT_SUBMODULE_STRATEGY: recursive PREFIX: /usr/ DOCKER_TAG_DEV: ${CI_BUILD_REF_SLUG} DOCKER_IMAGE_DEV: villas/fpga-dev -# For some reason, GitLab CI prunes the contents of the submodules so we need to restore them. -before_script: - - git submodule foreach git checkout . - stages: - prepare - build - test -# - deploy # Stage: prepare ############################################################################## @@ -43,19 +37,6 @@ build:source: tags: - docker -#build:packages: -# stage: build -# script: -# - mkdir build && cd build && cmake3 .. && make package -# artifacts: -# expire_in: 1 week -# name: ${CI_PROJECT_NAME}-${CI_BUILD_REF} -# paths: -# - build/ -# image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV} -# tags: -# - docker - # Stage: test ############################################################################## @@ -66,32 +47,12 @@ test:unit: - cuda allow_failure: true script: | - rm -r build && mkdir build && cd build && cmake3 .. && make unit-tests -j8 + rm -r build && mkdir build && cd build + cmake3 .. + make -j$(nproc) unit-tests if [ "$(who | wc -l)" -eq "0" ]; then - tests/unit-tests --jobs 1 --filter 'fpga/*' + tests/fpga-unit-tests --jobs 1 --filter 'fpga/*' else echo "System is currently used by: $(who)" echo "We are skipping the test. Please restart manually." fi - -# Stage: deploy -############################################################################## - -#deploy:packages: -# stage: deploy -# script: -# - ssh ${DEPLOY_USER}@${DEPLOY_HOST} mkdir -p ${DEPLOY_PATH}/{dist,../packages} -# - rsync ${RSYNC_OPTS} build/*.rpm ${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}/../packages/ -# - rsync ${RSYNC_OPTS} build//*.tar.gz ${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}/dist/ -# - ssh ${DEPLOY_USER}@${DEPLOY_HOST} createrepo ${DEPLOY_PATH}/../packages -# dependencies: -# - build:packages -# tags: -# - villas-deploy -# only: -# - tags -# -#deploy:git-mirror: -# stage: deploy -# script: -# - git push --force --mirror --prune https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com:VILLASframework/VILLASnode.git diff --git a/fpga/CMakeLists.txt b/fpga/CMakeLists.txt index 2531ea8f9..ab1a1c66f 100644 --- a/fpga/CMakeLists.txt +++ b/fpga/CMakeLists.txt @@ -51,6 +51,8 @@ endif() include(FindPkgConfig) +set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/local/share/pkgconfig:/usr/lib64/pkgconfig") + pkg_check_modules(JANSSON REQUIRED IMPORTED_TARGET jansson) pkg_check_modules(XIL REQUIRED IMPORTED_TARGET libxil) diff --git a/fpga/Dockerfile b/fpga/Dockerfile index 00924d1c7..ab34ee66b 100644 --- a/fpga/Dockerfile +++ b/fpga/Dockerfile @@ -71,7 +71,6 @@ RUN git clone --recursive https://github.com/fmtlib/fmt.git /tmp/fmt && \ make -j$(nproc) install && \ rm -rf /tmp/fmt - # Build & Install spdlog RUN git clone --recursive https://github.com/gabime/spdlog.git /tmp/spdlog && \ mkdir -p /tmp/spdlog/build && cd /tmp/spdlog/build && \ @@ -81,12 +80,19 @@ RUN git clone --recursive https://github.com/gabime/spdlog.git /tmp/spdlog && \ rm -rf /tmp/spdlog # Build & Install Criterion -COPY thirdparty/criterion /tmp/criterion -RUN mkdir -p /tmp/criterion/build && cd /tmp/criterion/build && cmake3 .. && make install && rm -rf /tmp/* +RUN git clone --recursive https://github.com/Snaipe/Criterion /tmp/criterion && \ + mkdir -p /tmp/criterion/build && cd /tmp/criterion/build && \ + git checkout v2.3.3 && \ + cmake3 .. && \ + make -j$(nproc) install && \ + rm -rf /tmp/* # Build & Install libxil -COPY thirdparty/libxil /tmp/libxil -RUN mkdir -p /tmp/libxil/build && cd /tmp/libxil/build && cmake3 .. && make install && rm -rf /tmp/* +RUN git clone https://git.rwth-aachen.de/acs/public/villas/fpga/libxil.git /tmp/libxil && \ + mkdir -p /tmp/libxil/build && cd /tmp/libxil/build && \ + cmake3 .. && \ + make -j$(nproc) install && \ + rm -rf /tmp/* ENV LD_LIBRARY_PATH /usr/local/lib:/usr/local/lib64