Circle CI integration
authorLukasz Stanislawski <l.stanislaws@samsung.com>
Wed, 4 Nov 2020 14:57:05 +0000 (15:57 +0100)
committerPiotr Czaja <p.czaja@samsung.com>
Tue, 14 Sep 2021 11:01:34 +0000 (13:01 +0200)
This patch add following checks:
* build warnings check
* format check with dotnet-format tool
* sonar cube analysis
* sam report preparation

.circleci/config.yml [new file with mode: 0644]
README.md
sam_cli.cfg [new file with mode: 0644]
src_exclude.cfg [new file with mode: 0644]

diff --git a/.circleci/config.yml b/.circleci/config.yml
new file mode 100644 (file)
index 0000000..8858adc
--- /dev/null
@@ -0,0 +1,49 @@
+version: 2
+jobs:
+  build:
+    docker:
+      - image: art.sec.samsung.net/tizenwearable_docker/ci:v0.18
+        environment:
+          PIPENV_VENV_IN_PROJECT: true
+    environment:
+      http_proxy: http://10.112.1.184:8080
+      https_proxy: http://10.112.1.184:8080
+      no_proxy: 106.120.130.80,sonar.sprc.samsung.pl
+
+    working_directory: ~/project
+    steps:
+      - run: curl -sL https://art.sec.samsung.net/artifactory/tools/CircleCI/scripts/set_proxy_setting.sh | sh
+      - checkout
+      - run:
+          name: Code formatting
+          command: dotnet format --check
+      - run:
+          name: Build warnings check
+          command: |
+            dotnet build $PROJECT_NAME.sln --configuration Release -p:TreatWarningsAsErrors=true
+      - run:
+          name: SonarQube Analyzer
+          command: |
+            dotnet-sonarscanner begin /k:"$SONAR_PROJECT_NAME" /d:sonar.host.url="https://sonar.sprc.samsung.pl" /d:sonar.login=$SONAR_TOKEN
+            dotnet build $PROJECT_NAME.sln --configuration Release
+            dotnet-sonarscanner end /d:sonar.login=$SONAR_TOKEN
+      - run:
+          name: SAM
+          command: |
+              sam_cli.sh ./sam_cli.cfg
+      - run:
+          name: ZIP SAM report
+          command: |
+              zip -r ./${PROJECT_NAME}_SAM.zip ./output
+      - run:
+          name: Upload SAM report
+          command: |
+              ssh -o StrictHostKeyChecking=no ${REPORTS_STORAGE_USER}@${REPORTS_STORAGE_HOST} mkdir -p /home/${REPORTS_STORAGE_USER}/www/sam/results/${PROJECT_NAME}_SAM_output/${CIRCLE_BRANCH}
+              rsync -aP ./output ${REPORTS_STORAGE_USER}@${REPORTS_STORAGE_HOST}:~/www/sam/results/${PROJECT_NAME}_SAM_output/${CIRCLE_BRANCH} -e "ssh -o StrictHostKeyChecking=no"
+              rsync -aP ./${PROJECT_NAME}_SAM.zip ${REPORTS_STORAGE_USER}@${REPORTS_STORAGE_HOST}:~/www/sam/results/${PROJECT_NAME}_SAM_output/${CIRCLE_BRANCH}/ -e "ssh -o StrictHostKeyChecking=no"
+
+workflows:
+  version: 2
+  build:
+    jobs:
+      - build
index 8c84f38..b5b2a16 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,3 +1,5 @@
+[![CircleCI](https://circleci.sec.samsung.net/gh/l-stanislaws/fitness.svg?style=svg)](https://circleci.sec.samsung.net/gh/l-stanislaws/fitness)
+
 # The fitness
     * A collaboration project between PM and MM parts
     * New fitness application for killer solution of Tizen next
diff --git a/sam_cli.cfg b/sam_cli.cfg
new file mode 100644 (file)
index 0000000..8188b04
--- /dev/null
@@ -0,0 +1,86 @@
+#!/usr/bin/env bash
+#
+# Copyright (C) 2019 The SAM Tool Authors. All rights reserved.
+#
+#               SAM (S/W Architecture Maturity)
+#
+# Samsung Research,
+# Samsung Electronics Co., Ltd.
+#
+# This software and its documentation are confidential and proprietary
+# information of Samsung Electronics Co., Ltd.  No part of the software and
+# documents may be copied, reproduced, transmitted, translated, or reduced to
+# any electronic medium or machine-readable form without the prior written
+# consent of Samsung Electronics.
+#
+# Samsung Electronics makes no representations with respect to the contents,
+# and assumes no responsibility for any errors that might appear in the
+# software and documents. This publication and the contents here of are subject
+# to change without notice.
+#
+
+################################
+# Project Name
+################################
+SAM_PRJ_NAME="Fitness"
+
+
+################################
+# Source Code
+################################
+BUILD_CMD="dotnet build"
+CLEAN_CMD="dotnet clean"
+SRC_PATH="$PWD/Fitness"
+SRC_LANG="cs"                               # Supported languages : c, cpp, auto_c_cpp, java, cs
+#SRC_SCOPE="config/src_scope.cfg"           # Scoping list
+SRC_EXCLUDE="src_exclude.cfg"               # Excluding list
+
+
+################################
+# SCRA
+################################
+SCRA_SKIP=FALSE                             # Options : TRUE, FALSE
+SCRA_RAW_DATA_PATH=".scap/workspace/scra"
+SCRA_ROOT_TO_CUT=$SRC_PATH
+#SCRA_USE_PARAM=TRUE
+
+
+################################
+# ART_BEAN (Convert SCRA data)
+################################
+ART_BEAN_SKIP=FALSE                         # Options : TRUE, FALSE
+
+
+################################
+# PMD CPD (Duplicated Code)
+################################
+PMD_SKIP=FALSE                              # Options : TRUE, FALSE
+PMD_RAW_DATA_PATH=".scap/workspace/pmd"
+PMD_USE_BUILT_PATH=FALSE                    # Options : TRUE, FALSE
+PMD_ROOT_TO_CUT=$SRC_PATH
+#PMD_EXCLUDE_LIST="config/src_exclude.cfg"  # Excluding list of PMD
+#PMD_RESULT_DETAIL_MODE=FALSE               # Options : TRUE, FALSE
+#PMD_HEAP_SIZE=2048m
+#PMD_ENCODING="utf-8"
+
+
+################################
+# Metrix++ (Preprocessor)
+###############################
+MPP_SKIP=FALSE
+MPP_RAW_DATA_PATH=".scap/workspace/metrixpp"
+MPP_ROOT_TO_CUT=$SRC_PATH
+#MPP_USE_BUILT_PATH=TRUE
+
+
+################################
+# Advanced Option
+################################
+#ADVANCED_SAM_OPTION="config/sam.cfg"
+#USE_EMBEDDED_LIB=TRUE
+#LMCD_INIT=FALSE
+
+SCAP_TOOL_PATH="hub/code-analysis-hub/bin/scap"
+SCAP=$SCAP_TOOL_PATH
+
+SEND_DATA_FLAG=FALSE
diff --git a/src_exclude.cfg b/src_exclude.cfg
new file mode 100644 (file)
index 0000000..9cc0378
--- /dev/null
@@ -0,0 +1,2 @@
+Fitness/bin
+Fitness/obj