|
6 | 6 |
|
7 | 7 | jobs: |
8 | 8 | SonarQualityGate: |
9 | | - runs-on: ubuntu-latest |
10 | | - steps: |
11 | | - - name: Извлечение исходников PR |
12 | | - if: github.event_name == 'pull_request_target' || github.event_name == 'pull_request' |
13 | | - uses: actions/checkout@v4 |
14 | | - with: |
15 | | - ref: refs/pull/${{ github.event.number }}/merge # Для поддержки pull_request и pull_request_target |
16 | | - fetch-depth: 0 # Получение полной истории (все тэги и ветки) |
17 | | - |
18 | | - - name: Извлечение исходников ветки ${{ github.ref_name }} |
19 | | - if: github.event_name == 'push' |
20 | | - uses: actions/checkout@v4 |
21 | | - with: |
22 | | - fetch-depth: 0 # Получение полной истории (все тэги и ветки) |
23 | | - |
24 | | - - name: Извлечение версии проекта |
25 | | - uses: ./.github/actions/extract-version |
26 | | - with: |
27 | | - path: ./exts/yaxunit/src |
28 | | - id: extract_version |
29 | | - |
30 | | - # Анализ проекта в SonarQube (ветка) |
31 | | - - name: Анализ в SonarQube (${{ github.ref_name }}) |
32 | | - if: github.event_name == 'push' |
33 | | - uses: sonarsource/sonarqube-scan-action@v2.3.0 |
34 | | - env: |
35 | | - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
36 | | - LC_ALL: "ru_RU.UTF-8" |
37 | | - with: |
38 | | - args: > |
39 | | - -Dsonar.host.url=https://sonar.openbsl.ru |
40 | | - -Dsonar.branch.name=${{ github.ref_name }} |
41 | | - -Dsonar.projectVersion=${{ steps.extract_version.outputs.version }} |
42 | | - -Dsonar.qualitygate.wait=true |
43 | | - -Dsonar.qualitygate.timeout=300 |
44 | | -
|
45 | | - # Анализ проекта в SonarQube (PR) |
46 | | - # https://docs.sonarqube.org/latest/analysis/pull-request/ |
47 | | - - name: Анализ в SonarQube (pull-request ${{ github.event.number }}) |
48 | | - if: github.event_name == 'pull_request_target' || github.event_name == 'pull_request' |
49 | | - uses: sonarsource/sonarqube-scan-action@v2.3.0 |
50 | | - env: |
51 | | - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
52 | | - with: |
53 | | - args: > |
54 | | - -Dsonar.host.url=https://sonar.openbsl.ru |
55 | | - -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} |
56 | | - -Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }} |
57 | | - -Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }} |
58 | | - -Dsonar.scm.revision=${{ github.event.pull_request.head.sha }} |
59 | | - -Dsonar.qualitygate.wait=true |
60 | | - -Dsonar.qualitygate.timeout=300 |
61 | | -
|
62 | | - - name: Публикация результата проверки PR |
63 | | - if: github.event_name != 'push' && (success()||failure()) |
64 | | - uses: 1CDevFlow/sonar-review-action@main |
65 | | - with: |
66 | | - sonar_branch_plugin: true |
67 | | - env: |
68 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 9 | + uses: "1CDevFlow/workflows/.github/workflows/sonar-analysis-with-openbsl.yml@main" |
| 10 | + with: |
| 11 | + root-project-path: ./exts/yaxunit/src |
| 12 | + secrets: |
| 13 | + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
69 | 14 |
|
0 commit comments