mirror of
https://github.com/firstBitSportivnaya/PSSL.git
synced 2024-11-28 08:58:53 +02:00
3d51f63425
Добавлена проверка пулл-реквестов
46 lines
1.4 KiB
YAML
46 lines
1.4 KiB
YAML
name: QA
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
# Disabling shallow clone is recommended for improving relevancy of reporting
|
|
fetch-depth: 0
|
|
|
|
- name: Compute branch name
|
|
uses: nelonoel/branch-name@v1.0.1
|
|
|
|
- name: Setup sonarqube
|
|
uses: warchant/setup-sonar-scanner@v8
|
|
|
|
# Анализ проекта в SonarQube (ветка)
|
|
- name: Анализ в SonarQube (branch)
|
|
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=${{ env.BRANCH_NAME }}
|
|
# Анализ проекта в SonarQube (пулл-реквест)
|
|
- name: Анализ в SonarQube (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 }}
|
|
|