diff --git a/.github/workflows/sonar-scanner.yml b/.github/workflows/sonar-scanner.yml new file mode 100644 index 000000000..4a1565fb0 --- /dev/null +++ b/.github/workflows/sonar-scanner.yml @@ -0,0 +1,45 @@ +name: sonar-scanner + +on: + pull_request: + branches: + - master + push: + branches: + - master + - develope + +jobs: + SonarScanner: + if: github.repository == 'BlizD/Tasks' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: '' + - run: | + git fetch --prune --unshallow + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Setup SonarQube scanner + uses: warchant/setup-sonar-scanner@v1 + - name: Run SonarQube on push + if: github.event_name == 'push' + run: sonar-scanner + -Dsonar.login=${{ secrets.SONAR_TOKEN }} + -Dsonar.host.url=https://sonar.openbsl.ru + -Dsonar.branch.name=${GITHUB_REF#refs/heads/} + -Dsonar.bsl.languageserver.enabled=true + - name: Run SonarQube on pull request + if: github.event_name == 'pull_request' + run: sonar-scanner + -X + -Dsonar.login=${{ secrets.SONAR_TOKEN }} + -Dsonar.host.url=https://sonar.openbsl.ru + -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.bsl.languageserver.enabled=true diff --git a/README.md b/README.md index a7cdaebf7..a8d645eb9 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [![Infostart](https://img.shields.io/badge/infostart-downloads%20500-blue.svg)](https://infostart.ru/public/552480/) [![1clancer.ru](https://img.shields.io/badge/1clancer.ru-downloads%20750-orange.svg)](http://1clancer.ru/catalog/2764) [![Github Releases](https://img.shields.io/github/downloads/BlizD/Tasks/latest/total.svg)]() +[![Quality Gate Status](https://sonar.openbsl.ru/api/project_badges/measure?project=tasks&metric=alert_status)](https://sonar.openbsl.ru/dashboard?id=tasks) [![telegram](https://img.shields.io/badge/telegram-channal-green.svg)](https://t.me/mtasks) [![telegram](https://img.shields.io/badge/telegram-chat-green.svg)](https://t.me/joinchat/KbD_hhM1tJGb3B3gz6QIvA) @@ -135,4 +136,4 @@ * Как, когда и кому отправляются уведомленияи - https://github.com/BlizD/Tasks/wiki/Уведомления * Telegram - настройка отправки уведомлений - https://github.com/BlizD/Tasks/wiki/Telegram---настройка-отправки-уведомлений * Настройка получения почты по протоколу IMAP - https://github.com/BlizD/Tasks/wiki/Настройка-получения-почты-по-протоколу-IMAP -* Как настроить загрузку изменений из хранилища, если хранилище серверное - https://github.com/BlizD/Tasks/wiki/Как-настроить-загрузку-изменений-из-хранилища,-если-хранилище-серверное \ No newline at end of file +* Как настроить загрузку изменений из хранилища, если хранилище серверное - https://github.com/BlizD/Tasks/wiki/Как-настроить-загрузку-изменений-из-хранилища,-если-хранилище-серверное diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 000000000..f2f32f441 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,11 @@ +sonar.projectName=Tasks +sonar.projectKey=tasks + +sonar.sourceEncoding=UTF-8 +sonar.sources=./src +sonar.inclusions=**/*.bsl + +sonar.scm.enabled=true +sonar.scm.provider=git + +sonar.projectVersion=1.0.5.001