diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 35d868bc6395d3eab1a4fd1435f0f42c2540196d..9b8c6d44cdc28d62c627a8dafac66683855dd4d8 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -115,12 +115,13 @@ build test project:
     - *create-project
     # Generate `composer.json` by merging our dev requirements into the project template.
     - .ddev/homeadditions/bin/generate-composer-json > $BUILD_DIR/composer.json
-    # If this is a "canary" build, allow dev versions of all dependencies.
-    - if [ -n "$CANARY" ]; then composer config prefer-stable false --working-dir=$BUILD_DIR; fi
+    - cd $BUILD_DIR
+    - if [ -n "$CANARY_CORE_RECOMMENDED" ]; then composer require --no-update "drupal/core-recommended:$CANARY_CORE_RECOMMENDED"; fi
+    - if [ -n "$CANARY_PREFER_STABLE" ]; then composer config prefer-stable $CANARY_PREFER_STABLE; fi
     # Install dependencies.
-    - composer install --working-dir=$BUILD_DIR
+    - composer install
     # Remove all `.git` directories in the built project.
-    - find $BUILD_DIR -depth -type d -name '.git' -exec rm -r -f {} ';'
+    - find . -depth -type d -name '.git' -exec rm -r -f {} ';'
   artifacts:
     paths:
       - $BUILD_DIR