mirror of
https://github.com/BlizD/Tasks.git
synced 2025-03-17 20:58:01 +02:00
Sonar Scanner
Проверки: 1. Запуск проверки при пуше в Дев или Мастер 2. Запуск проверки при пул реквесте в Мастер
This commit is contained in:
parent
0e84388611
commit
010628eca0
45
.github/workflows/sonar-scanner.yml
vendored
Normal file
45
.github/workflows/sonar-scanner.yml
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
name: sonar-scanner
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- develop
|
||||
|
||||
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
|
Loading…
x
Reference in New Issue
Block a user