From 1873e2d74a58991f673e43cb59f5c0d1e9645618 Mon Sep 17 00:00:00 2001 From: Janek Date: Fri, 15 Apr 2022 08:01:05 +0200 Subject: [PATCH] Configured Sonar (#233) * Configured Sonar * typo * just to trigger build * updated projectKey * updated config * added I6X commit-tests, * separated sonar job * disable companion * add compiler * changed image * try to reload path, added pillow --- .circleci/config.yml | 50 +++++++++++++++++++++++++++++++--------- sonar-project.properties | 12 ++++------ tools/commit-tests.sh | 11 ++++++++- 3 files changed, 54 insertions(+), 19 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9fead1974..25482026c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,6 +10,25 @@ parameters: # Define a job to be invoked later in a workflow. # See: https://circleci.com/docs/2.0/configuration-reference/#jobs jobs: + sonar-scan: + docker: + - image: cimg/python:3.10.4 + steps: + - checkout + - run: + name: Build + command: | + wget https://launchpad.net/gcc-arm-embedded/4.7/4.7-2013-q3-update/+download/gcc-arm-none-eabi-4_7-2013q3-20130916-linux.tar.bz2 -P /tmp + tar -C /tmp -xjf /tmp/gcc-arm-none-eabi-4_7-2013q3-20130916-linux.tar.bz2 + export PATH=$PATH:/tmp/gcc-arm-none-eabi-4_7-2013q3/bin + pip3 install pillow libclang-py3 pyqt5 + sudo apt-get update -y + sudo apt-get install -y libclang-6.0-dev + curl -L -O https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip + unzip -o build-wrapper-linux-x86.zip + build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw_output ./tools/commit-tests.sh -Wno-error + - sonarcloud/scan + build-elrsv2: machine: image: ubuntu-2004:202111-02 @@ -21,6 +40,7 @@ jobs: - store_artifacts: path: opentx-i6x-<< pipeline.parameters.build-version >>.bin destination: openi6x-<< pipeline.parameters.build-version >>-elrsv2.bin + build-standard: machine: image: ubuntu-2004:202111-02 @@ -32,6 +52,7 @@ jobs: - store_artifacts: path: opentx-i6x-<< pipeline.parameters.build-version >>.bin destination: openi6x-<< pipeline.parameters.build-version >>.bin + build-heli: machine: image: ubuntu-2004:202111-02 @@ -43,22 +64,29 @@ jobs: - store_artifacts: path: opentx-i6x-<< pipeline.parameters.build-version >>.bin destination: openi6x-<< pipeline.parameters.build-version >>-heli.bin - publish-github-release: - docker: - - image: cibuilds/github:0.13 - steps: - - attach_workspace: - at: /tmp - - run: - name: "Publish Release on GitHub" - command: | - ls -la - ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete nightly-latest $CIRCLE_ARTIFACTS/ + +# publish-github-release: +# docker: +# - image: cibuilds/github:0.13 +# steps: +# - attach_workspace: +# at: /tmp +# - run: +# name: "Publish Release on GitHub" +# command: | +# ls -la +# ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete nightly-latest $CIRCLE_ARTIFACTS/ + +orbs: + sonarcloud: sonarsource/sonarcloud@1.0.3 + # Invoke jobs via workflows # See: https://circleci.com/docs/2.0/configuration-reference/#workflows workflows: openi6x-release-workflow: jobs: + - sonar-scan: + context: SonarCloud - build-elrsv2 #: # filters: # branches: diff --git a/sonar-project.properties b/sonar-project.properties index 222b07ae9..06ac071b2 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,9 +1,7 @@ -sonar.host.url = https://sonarcloud.io -sonar.projectKey = OpenTX -sonar.organization = opentx-github -sonar.projectName = OpenTX -sonar.projectVersion = 2.2 -sonar.sources = . +sonar.projectKey=OpenI6X_opentx +sonar.organization=openi6x +sonar.projectName=OpenTX +sonar.sources=. sonar.exclusions = sound/**, build/**, radio/src/thirdparty/** sonar.cfamily.build-wrapper-output = bw_output - +sonar.cfamily.threads=2 diff --git a/tools/commit-tests.sh b/tools/commit-tests.sh index 70d54f240..f5fb4cb67 100755 --- a/tools/commit-tests.sh +++ b/tools/commit-tests.sh @@ -10,7 +10,7 @@ num_cpus=`grep 'physical id' /proc/cpuinfo | sort -u | wc -l` # Default build treats warnings as errors, set -Wno-error to override, e.g.: commit-tests.sh -Wno-error : ${WERROR:=1} # A board name to build for, or ALL -: ${FLAVOR:=ALL} +: ${FLAVOR:=I6X} for i in "$@" do @@ -159,6 +159,15 @@ if [[ " X12S HORUS ALL " =~ " ${FLAVOR} " ]] ; then make -j${CORES} gtests ; ./gtests ${TEST_OPTIONS} fi +if [[ " I6X ALL " =~ " ${FLAVOR} " ]] ; then + # OpenTX on FlySky FS-i6X + rm -rf * + cmake ${COMMON_OPTIONS} -DPCB=I6X -DHELI=NO -DLUA=NO -DGVARS=YES -DLUA_COMPILER=NO -DMULTIMODULE=NO -DPCBI6X_ELRSV2=YES -DDISABLE_COMPANION=YES ${SRCDIR} + make -j${CORES} ${FIRMARE_TARGET} +# make -j${CORES} libsimulator +# make -j${CORES} gtests ; ./gtests ${TEST_OPTIONS} +fi + if [[ " DEFAULT ALL " =~ " ${FLAVOR} " ]] ; then # Companion rm -rf *