mirror of
https://github.com/vbondarevsky/Connector.git
synced 2025-02-15 13:33:20 +02:00
91 lines
3.5 KiB
YAML
91 lines
3.5 KiB
YAML
name: sonar-scanner
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
types: [opened, synchronize, reopened]
|
|
|
|
jobs:
|
|
sonar-scanner_ru:
|
|
if: github.repository == 'vbondarevsky/Connector'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v1
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Setup SonarQube scanner
|
|
uses: nixel2007/sonarcloud-github-action@v1.4
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
- name: Extract version
|
|
shell: bash
|
|
run: echo "##[set-output name=version;]` cat ./src/ru/CommonModules/КоннекторHTTP/Ext/Module.bsl | grep -oP '(?<=Версия:.)[\d|.]*'`"
|
|
id: extract_version
|
|
- name: Run SonarQube on push
|
|
if: github.event_name == 'push'
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
run: sonar-scanner
|
|
-Dsonar.host.url=https://sonar.openbsl.ru
|
|
-Dsonar.branch.name=${GITHUB_REF#refs/heads/}
|
|
-Dsonar.projectVersion=${{ steps.extract_version.outputs.version }}
|
|
-Dproject.settings=sonar-project.properties_ru
|
|
- name: Run SonarQube on pull request
|
|
if: github.event_name == 'pull_request'
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
run: sonar-scanner
|
|
-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.scm.revision=${{ github.event.pull_request.head.sha }}
|
|
-Dproject.settings=sonar-project.properties_ru
|
|
|
|
sonar-scanner_en:
|
|
if: github.repository == 'vbondarevsky/Connector'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v1
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Setup SonarQube scanner
|
|
uses: nixel2007/sonarcloud-github-action@v1.4
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
- name: Extract version
|
|
shell: bash
|
|
run: echo "##[set-output name=version;]` cat ./src/en/CommonModules/HTTPConnector/Ext/Module.bsl | grep -oP '(?<=Version:.)[\d|.]*'`"
|
|
id: extract_version
|
|
- name: Run SonarQube on push
|
|
if: github.event_name == 'push'
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
run: sonar-scanner
|
|
-Dsonar.host.url=https://sonar.openbsl.ru
|
|
-Dsonar.branch.name=${GITHUB_REF#refs/heads/}
|
|
-Dsonar.projectVersion=${{ steps.extract_version.outputs.version }}
|
|
-Dproject.settings=../myproject.properties
|
|
-Dproject.settings=sonar-project.properties_en
|
|
- name: Run SonarQube on pull request
|
|
if: github.event_name == 'pull_request'
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
run: sonar-scanner
|
|
-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.scm.revision=${{ github.event.pull_request.head.sha }}
|
|
-Dproject.settings=sonar-project.properties_en
|