From 844fadcb76a80f44fc799bfd88afb813e46395af Mon Sep 17 00:00:00 2001
From: dwn1c21 <d.newbrook@soton.ac.uk>
Date: Wed, 5 Jul 2023 18:28:33 +0000
Subject: [PATCH] CI add compilation phase

---
 .gitlab-ci.yml | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2822c3a..ccde9db 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -17,6 +17,7 @@
 # https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml
 
 stages:          # List of stages for jobs, and their order of execution
+  - compile
   - simulate
   - build
   - deploy
@@ -25,6 +26,20 @@ variables:
   GIT_SUBMODULE_STRATEGY: recursive
   GIT_SUBMODULE_FORCE_HTTPS: "true"
 
+compile-software:
+  stage: compile
+  script:
+    - echo "Compilation phase started"
+    - git submodule foreach --recursive git submodule init
+    - git fetch --recurse-submodules
+    - source set_env.sh
+    - cd $SOCLABS_NANOSOC_TECH_DIR
+    - make compile_all_code
+  artifacts:
+    paths:
+      - $SOCLABS_PROJECT_DIR/simulate/sim/*/*.hex
+  tags:
+    - ds5
 
 simulate-nanosoc:
   stage: simulate
-- 
GitLab