From 0a5ccddae42010cd55333322a06ab27f86570992 Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pavel.zhukov@huawei.com>
Date: Tue, 28 Jun 2022 09:28:40 +0200
Subject: [PATCH] oniro-ci: Add clang jobs

Add first clang jobs.
This should be factorized and moved to workspace definition once clang
is ready. In current situation defining all build jobs as matrix causes
dependencies issue similar to one in [1]

[1] https://gitlab.eclipse.org/eclipse/oniro-core/oniro/-/issues/574

Signed-off-by: Pavel Zhukov <pavel.zhukov@huawei.com>
---
 .oniro-ci/machines-and-flavours.yaml | 118 ++++++++++++++++++++++++++-
 1 file changed, 117 insertions(+), 1 deletion(-)

diff --git a/.oniro-ci/machines-and-flavours.yaml b/.oniro-ci/machines-and-flavours.yaml
index 3f544b5c..31f85d34 100644
--- a/.oniro-ci/machines-and-flavours.yaml
+++ b/.oniro-ci/machines-and-flavours.yaml
@@ -20,6 +20,12 @@ linux-qemu-x86:
     # tainted build intermediate files, downloads or published artifacts.
     CI_ONIRO_BB_LOCAL_CONF_BB_GENERATE_MIRROR_TARBALLS: 1
     CI_ONIRO_JOB_ARTIFACTS: "*.wic.* *.bmap ovmf.qcow2"
+  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"
 
 linux-qemu-x86_64:
   extends: .build-wic-image
@@ -31,13 +37,31 @@ linux-qemu-x86_64:
     CI_ONIRO_BUILD_CACHE: "pub"
     CI_ONIRO_BB_LOCAL_CONF_BB_GENERATE_MIRROR_TARBALLS: 1
     CI_ONIRO_JOB_ARTIFACTS: "*.wic.* *.bmap ovmf.qcow2"
+  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"
+
 
 linux-seco-intel-b68:
   extends: .build-wic-image
   variables:
+    MACHINE: seco-intel-b68
     CI_ONIRO_BUILD_FLAVOUR: linux
     CI_ONIRO_RECIPE_NAME: oniro-image-base-tests
-    MACHINE: seco-intel-b68
+  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
+      when: manual
+    - when: on_success
 
 linux-seco-intel-b68-extra:
   extends: .build-linux
@@ -64,6 +88,17 @@ linux-seco-imx8mm-c61-4gb:
     # See build-generic.yaml for explanation of CI_ONIRO_BB_LOCAL_CONF_ variables.
     CI_ONIRO_BB_LOCAL_CONF_ACCEPT_FSL_EULA: 1
     CI_ONIRO_JOB_ARTIFACTS: "*.wic.* *.bmap flash.bin-seco-imx8mm-c61*"
+  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
+      when: manual
+    - when: on_success
 
 linux-seco-imx8mm-c61-4gb-extra:
   extends: .build-linux
@@ -82,6 +117,18 @@ linux-raspberrypi4-64:
     CI_ONIRO_BUILD_FLAVOUR: linux
     CI_ONIRO_RECIPE_NAME: oniro-image-base-tests
 
+linux-raspberrypi4-64-clang:
+  extends: .build-wic-image
+  variables:
+    MACHINE: raspberrypi4-64
+    CI_ONIRO_BUILD_FLAVOUR: linux
+    CI_ONIRO_RECIPE_NAME: oniro-image-base-tests
+    CI_ONIRO_BB_LOCAL_CONF_TOOLCHAIN: "clang"
+    CI_ONIRO_BB_LOCAL_CONF_RUNTIME: "llvm"
+  rules:
+    when: manual
+    allow_failure: true
+
 zephyr-qemu-x86:
   extends: .build-zephyr-image
   variables:
@@ -92,6 +139,17 @@ zephyr-qemu-x86:
     CI_ONIRO_RECIPE_NAME: zephyr-philosophers
     CI_ONIRO_BUILD_FLAVOUR: zephyr
     CI_ONIRO_INSTANCE_SIZE: s3.large.2
+  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
+      when: manual
+    - when: on_success
 
 zephyr-qemu-cortex-m3:
   extends: .build-zephyr-image
@@ -103,6 +161,17 @@ zephyr-qemu-cortex-m3:
     CI_ONIRO_RECIPE_NAME: zephyr-philosophers
     CI_ONIRO_BUILD_FLAVOUR: zephyr
     CI_ONIRO_INSTANCE_SIZE: s3.large.2
+  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
+      when: manual
+    - when: on_success
 
 zephyr-96b-nitrogen:
   extends: .build-zephyr-image
@@ -111,6 +180,18 @@ zephyr-96b-nitrogen:
     CI_ONIRO_RECIPE_NAME: zephyr-philosophers
     CI_ONIRO_BUILD_FLAVOUR: zephyr
     CI_ONIRO_INSTANCE_SIZE: s3.large.2
+  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
+      when: manual
+    - when: on_success
+
 
 zephyr-96b-nitrogen-tests:
   extends: .build-zephyr-image
@@ -138,11 +219,35 @@ zephyr-nrf52840dk-nrf52840:
   extends: .build-zephyr
   variables:
     MACHINE: nrf52840dk-nrf52840
+  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
+      when: manual
+    - when: on_success
+
 
 zephyr-arduino-nano-33-ble:
   extends: .build-zephyr
   variables:
     MACHINE: arduino-nano-33-ble
+  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
+      when: manual
+    - when: on_success
+
 
 freertos-armv5:
   extends: .build-freertos
@@ -151,3 +256,14 @@ freertos-armv5:
     # See the note on linux-qemu-x86.
     CI_ONIRO_BUILD_CACHE: "pub"
     CI_ONIRO_BB_LOCAL_CONF_BB_GENERATE_MIRROR_TARBALLS: 1
+  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
+      when: manual
+    - when: on_success
-- 
GitLab