forked from vanessa-opensource/add
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
devops:vanessa-opensource#894 Актуализировал настройки проекта для со…
…нара, добавил джобу для анализа в sonarqube
- Loading branch information
Showing
2 changed files
with
70 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# MIT License | ||
# Copyright (C) 2020 Tymko Oleg <olegtymko@yandex.ru> and contributors | ||
# All rights reserved. | ||
|
||
name: Контроль качества | ||
# Любой пуш и pr в проекте но с фильтром по основному проекту | ||
on: [push, pull_request] | ||
jobs: | ||
task: | ||
if: github.repository == 'vanessa-opensource/add' | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
|
||
steps: | ||
# Загрузка проекта | ||
- name: Актуализация | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions | ||
- name: Извлечение имени текущей ветки | ||
shell: bash | ||
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | ||
id: extract_branch | ||
|
||
- name: Извлечение версии пакета | ||
shell: bash | ||
run: echo "##[set-output name=version;]`cat packagedef | grep "ВерсияПакета = " | sed 's|[^"]*"||' | sed -r 's/".+//'`" | ||
id: extract_version | ||
|
||
- name: Установка Sonar-scanner | ||
uses: warchant/setup-sonar-scanner@v1 | ||
|
||
# Анализ проекта в SonarQube (ветка) | ||
- name: Анализ в SonarQube (branch) | ||
if: github.event_name == 'push' | ||
run: sonar-scanner | ||
-Dsonar.login=${{ secrets.SONARQUBE_TOKEN }} | ||
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} | ||
-Dsonar.branch.name=${{ steps.extract_branch.outputs.branch }} | ||
-Dsonar.projectVersion=${{ steps.extract_version.outputs.version }} | ||
|
||
# Анализ проекта в SonarQube (PR) | ||
# https://docs.sonarqube.org/latest/analysis/pull-request/ | ||
- name: Анализ в SonarQube (pull-request) | ||
if: github.event_name == 'pull_request' | ||
run: sonar-scanner | ||
-Dsonar.login=${{ secrets.SONARQUBE_TOKEN }} | ||
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} | ||
-Dsonar.branch.name=${{ steps.extract_branch.outputs.branch }} | ||
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }} | ||
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }} | ||
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }} | ||
-Dsonar.scm.revision=${{ github.event.pull_request.head.sha }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,23 @@ | ||
## Настройки проекта для SonarQube - платформы проверки качества 1С решений | ||
# Ключ проекта | ||
sonar.projectKey=vanessa-opensource_add | ||
|
||
# must be unique in a given SonarQube instance | ||
sonar.projectKey=vanessa-add | ||
# this is the name displayed in the SonarQube UI | ||
# Имя проекта | ||
sonar.projectName=Vanessa-ADD (Vanessa Automation Driven Development) | ||
# sonar.projectVersion=6.0.0 | ||
|
||
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. | ||
# Since SonarQube 4.2, this property is optional if sonar.modules is set. | ||
# If not set, SonarQube starts looking for source code from the directory containing | ||
# the sonar-project.properties file. | ||
# Версия проекта | ||
# sonar.projectVersion= // устанавливать из CI таски | ||
|
||
# Базовый рабочий каталог | ||
sonar.projectBaseDir=. | ||
#sonar.sources=. | ||
|
||
sonar.inclusions=**/*.bsl, **/*.os | ||
# sonar.inclusions=**/*.bsl,**/*.os,**/*.xml | ||
sonar.exclusions=build/**,**/*.xml,**/*.json,tools/Sikuli/**/*.html,tools/**,lib/CF/** | ||
#sonar.exclusions=**/*.xml,**/*.html | ||
sonar.lang.patterns.xml=**/*.xsd,**/*.xsl | ||
|
||
sonar.bsl.skipVendorSupportedObjects=true | ||
# Что анализируется | ||
sonar.inclusions=**/*.bsl, **/*.os,**/*.xml | ||
|
||
# sonar.externalIssuesReportPaths=../../edt-validate-ext-rules.json | ||
# sonar.bsl.acc.resultsPath=../../acc.xml | ||
# Что исключается | ||
sonar.exclusions=build/**,**/*.json,tools/Sikuli/**/*.html,tools/**,lib/CF/** | ||
|
||
# Encoding of the source code. Default is default system encoding | ||
sonar.sourceEncoding=UTF-8 | ||
sonar.java.source=8 | ||
# sonar.branch.target=master | ||
# Заглушка для анализа xml-файлов | ||
sonar.lang.patterns.xml=**/*.xsd,**/*.xsl | ||
|
||
# sonar.login=admin | ||
# sonar.password=admin | ||
# sonar.host.url=http://localhost:9000 | ||
# Кодировка файлов | ||
sonar.sourceEncoding=UTF-8 |