From 391915d2b0c87a50362a57f4259997129dc52103 Mon Sep 17 00:00:00 2001
From: "orestis.malaspin" <orestis.malaspinas@hesge.ch>
Date: Sat, 1 Jul 2023 00:52:13 +0200
Subject: [PATCH] Added CI/CD

---
 .gitlab-ci.yml     | 12 ++++++++++++
 codes/run_tests.sh | 12 ++++++++++++
 2 files changed, 24 insertions(+)
 create mode 100644 .gitlab-ci.yml
 create mode 100755 codes/run_tests.sh

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..e126300
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,12 @@
+# Official language image. Look for the different tagged releases at:
+# https://hub.docker.com/r/library/rust/tags/
+image: "rust:1.70-alpine3.17"
+# Use cargo to test the project
+test:cargo:
+  script:
+    - rustc --version && cargo --version  # Print version info for debugging
+
+run_test_doc:
+  script:
+    - cd codes
+    - ./run_tests.sh
diff --git a/codes/run_tests.sh b/codes/run_tests.sh
new file mode 100755
index 0000000..feb0a29
--- /dev/null
+++ b/codes/run_tests.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+make -C c_lang/min_list
+cd rust_lang
+for d in *; do
+    echo ==================== Running cargo run for $d  ====================
+    cargo run --manifest-path $d/Cargo.toml
+    echo ==================== Running cargo test for $d ====================
+    cargo test --manifest-path $d/Cargo.toml --workspace --verbose
+    echo ==================== Running cargo doc for $d  ====================
+    cargo doc --manifest-path $d/Cargo.toml
+done
-- 
GitLab