diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 598b1452c584c4aeb11e3371c46d4eb31c378fc3..6bedf54cd12c795647933b3589d42b67d37e44ae 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -29,6 +29,8 @@ before_script: &before
     EOT
 
 dune:2.7 gcc:
+  variables:
+    DUNECI_BRANCH: releases/2.7
   image: registry.dune-project.org/docker/ci/dune:2.7-debian-10-gcc-8-17
   before_script:
   - *patch-dune-common
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e3e958a6d9fccd3a32402361e945f88671491889..9ad1ccab42e114445f194b919513cbae5c79eda2 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,10 +1,11 @@
 set(programs compute-disc-error
              cosserat-continuum
              gradient-flow
-             harmonicmaps
-             rod3d)
+             harmonicmaps)
 #            rodobstacle)
-
+if (${DUNE_COMMON_VERSION} VERSION_GREATER_EQUAL 2.8)
+  set (programs rod3d ${programs})
+endif()
 if (${DUNE_ELASTICITY_VERSION} VERSION_GREATER_EQUAL 2.8)
   set(programs film-on-substrate-stress-plot ${programs})
 endif()
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 980498b3df0ee64f8e1a7b83873580fbc385ccfb..0491fac87c48db3c01ce3f1f4a22076c01895797 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -3,7 +3,6 @@ set(TESTS
   averagedistanceassemblertest
   cosseratenergytest
   cosseratrodenergytest
-  cosseratrodtest
   harmonicenergytest
   localgeodesicfefunctiontest
   localgfetestfunctiontest
@@ -11,11 +10,18 @@ set(TESTS
   orthogonalmatrixtest
   rigidbodymotiontest
   rotationtest
-  surfacecosseratstressassemblertest
   svdtest
   targetspacetest
 )
 
+if (${DUNE_COMMON_VERSION} VERSION_GREATER_EQUAL 2.8)
+  set(TESTS cosseratrodtest ${TESTS})
+endif()
+
+if (${DUNE_COMMON_VERSION} VERSION_GREATER_EQUAL 2.8)
+  set(TESTS surfacecosseratstressassemblertest ${TESTS})
+endif()
+
 if(dune-foamgrid_FOUND)
   set(TESTS nonplanarcosseratenergytest ${TESTS})
 endif()
@@ -26,10 +32,12 @@ foreach(_test ${TESTS})
 endforeach()
 
 # Run distributed tests
+if (${DUNE_COMMON_VERSION} VERSION_GREATER_EQUAL 2.8)
 dune_add_test(SOURCES harmonicmaptest.cc
               MPI_RANKS 1 4
               TIMEOUT 600
               CMAKE_GUARD MPI_FOUND)
+endif()
 
 dune_add_test(SOURCES geodesicfeassemblerwrappertest.cc
               MPI_RANKS 1 4