From eda82c478a14db5e06b9f8d67343606cf7f79fba Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pavel.zhukov@huawei.com>
Date: Mon, 27 Jun 2022 17:54:10 +0200
Subject: [PATCH] .oniro-ci: Add clang jobs

Fixes: https://gitlab.eclipse.org/eclipse/oniro-core/oniro/-/issues/621
Signed-off-by: Pavel Zhukov <pavel.zhukov@huawei.com>
---
 .oniro-ci/build-generic.yaml | 51 +++++++++++++++++++++++++++++++++++-
 1 file changed, 50 insertions(+), 1 deletion(-)

diff --git a/.oniro-ci/build-generic.yaml b/.oniro-ci/build-generic.yaml
index 67abc4ad..8a098597 100644
--- a/.oniro-ci/build-generic.yaml
+++ b/.oniro-ci/build-generic.yaml
@@ -214,13 +214,31 @@
         time bitbake "$target"
         du -sh tmp
       done
+  parallel:
+    matrix:
+      - CI_ONIRO_BB_LOCAL_CONF_TOOLCHAIN: "clang" 
+        CI_ONIRO_BB_LOCAL_CONF_RUNTIME: "llvm"
+      - CI_ONIRO_BB_LOCAL_CONF_TOOLCHAIN: "gcc"
+        CI_ONIRO_BB_LOCAL_CONF_RUNTIME: "gnu"
+  rules:
+    - if: '$CI_ONIRO_BB_LOCAL_CONF_TOOLCHAIN == "clang"'
+      allow_failure: true
 
 # This job is documented in docs/ci/hidden-jobs/build-linux-marix.rst
 .build-linux-matrix:
   extends: .build-linux
   parallel:
     matrix:
-      - CI_ONIRO_BITBAKE_TARGETS: ["oniro-image-base-tests", "oniro-image-extra-tests"]
+      - CI_ONIRO_BB_LOCAL_CONF_TOOLCHAIN: "clang" 
+        CI_ONIRO_BB_LOCAL_CONF_RUNTIME: "llvm"
+        CI_ONIRO_BITBAKE_TARGETS: ["oniro-image-base-tests", "oniro-image-extra-tests"]
+      - CI_ONIRO_BB_LOCAL_CONF_TOOLCHAIN: "gcc"
+        CI_ONIRO_BB_LOCAL_CONF_RUNTIME: "gnu"
+        CI_ONIRO_BITBAKE_TARGETS: ["oniro-image-base-tests", "oniro-image-extra-tests"]
+  rules:
+    - if: '$CI_ONIRO_BB_LOCAL_CONF_TOOLCHAIN == "clang"'
+      allow_failure: true
+
 
 # This job is documented in docs/ci/hidden-jobs/build-zephyr.rst
 .build-zephyr:
@@ -238,6 +256,15 @@
       for target in $CI_ONIRO_BITBAKE_TARGETS; do
         time bitbake "$target"
       done
+  parallel:
+    matrix:
+      - CI_ONIRO_BB_LOCAL_CONF_TOOLCHAIN: "clang" 
+        CI_ONIRO_BB_LOCAL_CONF_RUNTIME: "llvm"
+      - CI_ONIRO_BB_LOCAL_CONF_TOOLCHAIN: "gcc"
+        CI_ONIRO_BB_LOCAL_CONF_RUNTIME: "gnu"
+  rules:
+    - if: '$CI_ONIRO_BB_LOCAL_CONF_TOOLCHAIN == "clang"'
+      allow_failure: true
 
 # This job is documented in docs/ci/hidden-jobs/build-freertos.rst
 .build-freertos:
@@ -249,6 +276,16 @@
   script:
     - !reference [.bitbake-workspace, script]
     - time bitbake freertos-demo
+  parallel:
+    matrix:
+      - CI_ONIRO_BB_LOCAL_CONF_TOOLCHAIN: "clang" 
+        CI_ONIRO_BB_LOCAL_CONF_RUNTIME: "llvm"
+      - CI_ONIRO_BB_LOCAL_CONF_TOOLCHAIN: "gcc"
+        CI_ONIRO_BB_LOCAL_CONF_RUNTIME: "gnu"
+  rules:
+    - if: '$CI_ONIRO_BB_LOCAL_CONF_TOOLCHAIN == "clang"'
+      when: on_success
+      allow_failure: true
 
 # This job is documented in docs/ci/hidden-jobs/build-recipe.rst
 .build-recipe:
@@ -295,6 +332,12 @@
   artifacts:
     paths:
       - artifacts/
+  parallel:
+    matrix:
+      - CI_ONIRO_BB_LOCAL_CONF_TOOLCHAIN: "clang" 
+        CI_ONIRO_BB_LOCAL_CONF_RUNTIME: "llvm"
+      - CI_ONIRO_BB_LOCAL_CONF_TOOLCHAIN: "gcc"
+        CI_ONIRO_BB_LOCAL_CONF_RUNTIME: "gnu"
 
 .build-wic-image:
   extends: .build-image
@@ -302,6 +345,12 @@
     CI_ONIRO_JOB_ARTIFACTS: "*.wic.* *.bmap"
   script:
     - !reference [.build-image, script]
+  parallel:
+    matrix:
+      - CI_ONIRO_BB_LOCAL_CONF_TOOLCHAIN: "clang" 
+        CI_ONIRO_BB_LOCAL_CONF_RUNTIME: "llvm"
+      - CI_ONIRO_BB_LOCAL_CONF_TOOLCHAIN: "gcc"
+        CI_ONIRO_BB_LOCAL_CONF_RUNTIME: "gnu"
 
 .build-rauc-bundle:
   extends: .build-image
-- 
GitLab