Commit b4ec4f87 authored by Lukas Riedel's avatar Lukas Riedel
Browse files

Add CI pipeline based on custom Docker image

* Add .gitlab-ci.yml specifying jobs for default builds,
  tests, and debug builds that report compiler warnings.
* Add Dockerfile for building the Docker image used in the
  CI pipeline.
* Add docker/README.md with instruction on how to build and
  upload the image.
parent 9c231edd
default:
image: registry.dune-project.org/lukas.riedel/dune-structures:env
variables:
# Add project directory to dunecontrol path
DUNE_CONTROL_PATH: /duneci/modules:$CI_PROJECT_DIR
CMAKE_FLAGS_DEFAULT:
-DDUNE_PYTHON_VIRTUALENV_SETUP=True
CMAKE_FLAGS: $CMAKE_FLAGS_DEFAULT
# Allow recursive cloning of submodules
GIT_SUBMODULE_STRATEGY: recursive
# Always void failing 'assert' statement
CXXFLAGS_DEFAULT: -DNDEBUG
CXXFLAGS: $CXXFLAGS_DEFAULT
workflow:
rules:
# Trigger pipeline after pushes, starting from web, or scheduling
- if: "$CI_PIPELINE_SOURCE == 'push'
|| $CI_PIPELINE_SOURCE == 'web'
|| $CI_PIPELINE_SOURCE == 'schedule'"
stages:
- build
- test
# --- BUILD STAGE ---
# Build release
build:all:
stage: build
script:
- dunecontrol --current all
artifacts:
paths:
- build-cmake/
expire_in: 6h
# Build with debugging and warnings (fail on warnings)
build:debug:
extends: build:all
allow_failure: true
variables:
# Fail on warnings
CXXFLAGS: $CXXFLAGS_DEFAULT -Wall -Werror
# NOTE: '-Werror' causes QuadMath compile test to fail, so skip it here
CMAKE_FLAGS:
$CMAKE_FLAGS_DEFAULT
-DCMAKE_BUILD_TYPE=Debug
-DQuadMath_COMPILES=True
# --- TEST STAGE ---
# Run tests
test:all:
stage: test
needs: ["build:all"]
script:
- dunecontrol --current bexec make test
artifacts:
paths:
- build-cmake/experiments/hansbo_reproduction/
expire_in: 1 day
# Docker Images
This directory contains source files for building Docker images required to
build and/or test the `dune-structures` module.
## Building the environment image
The environment image contains all packages for building and testing `dune-structures`.
It must be built manually using the `build-env.dockerfile`.
To use it in the GitLab CI/CD, it must be pushed to the container registry.
Follow these steps:
```bash
cd docker
docker build -f build-env.dockerfile -t registry.dune-project.org/lukas.riedel/dune-structures:env .
docker login registry.dune-project.org
docker push registry.dune-project.org/lukas.riedel/dune-structures:env
```
FROM registry.dune-project.org/docker/ci/dune:git
ARG DUNECI_PARALLEL=1
ARG DUNECI_CMAKE_FLAGS="-DDUNE_PYTHON_VIRTUALENV_SETUP=True"
# Base requirements
USER root
RUN apt-get update \
&& apt-get -y upgrade \
&& apt-get -y install gmsh libyaml-cpp-dev python3-pip python3-venv \
&& apt-get clean
USER duneci
# Configure dune-venv
WORKDIR /duneci/modules
RUN cmake -DDUNE_PYTHON_VIRTUALENV_SETUP=True dune-common/build-cmake
# alugrid, testtools, pdelab
RUN duneci-install-module --recursive https://gitlab.dune-project.org/extensions/dune-alugrid.git
RUN duneci-install-module --recursive https://gitlab.dune-project.org/quality/dune-testtools.git
RUN duneci-install-module --recursive https://gitlab.dune-project.org/pdelab/dune-pdelab.git
# Build dune-codegen after applying patches
WORKDIR /duneci/modules
RUN git clone --recurse-submodules https://gitlab.dune-project.org/extensions/dune-codegen.git
RUN cd /duneci/modules/dune-codegen && bash patches/apply_patches.sh && cd /duneci/modules/ \
&& dunecontrol --only=dune-codegen --opts="/duneci/dune.opts" all
# Build dune-blocklab after adding frontend requirements
WORKDIR /duneci/modules
RUN git clone --recurse-submodules https://gitlab.dune-project.org/dominic/dune-blocklab.git
RUN python3 -m pip install -r dune-blocklab/frontend/requirements.txt
RUN dunecontrol --only=dune-blocklab --opts="/duneci/dune.opts" all
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment