Skip to content

Commit d5773d6

Browse files
authored
Update qa.yml
1 parent 33981a8 commit d5773d6

File tree

1 file changed

+11
-75
lines changed

1 file changed

+11
-75
lines changed

.github/workflows/qa.yml

Lines changed: 11 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,14 @@
1-
# MIT License
2-
# Copyright (C) 2020 Tymko Oleg <olegtymko@yandex.ru> and contributors
3-
# All rights reserved.
4-
51
name: Контроль качества
6-
# Любой пуш и pr в проекте но с фильтром по основному проекту
7-
on: [push, pull_request]
8-
jobs:
9-
build:
10-
if: github.repository == 'oscript-library/gitsync'
11-
runs-on: ${{ matrix.os }}
12-
strategy:
13-
fail-fast: false
14-
matrix:
15-
os: [ubuntu-latest]
16-
oscript_version: ['1.8.4']
17-
18-
steps:
19-
# Загрузка проекта
20-
- name: Актуализация
21-
uses: actions/checkout@v2
22-
23-
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
24-
- name: Извлечение имени текущей ветки
25-
shell: bash
26-
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
27-
id: extract_branch
28-
29-
# Установка OneScript конкретной версии
30-
- name: Установка OneScript
31-
env:
32-
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
33-
uses: otymko/setup-onescript@v1.0
34-
with:
35-
version: ${{ matrix.oscript_version }}
362

37-
# Установка зависимостей пакета
38-
- name: Установка зависимостей
39-
run: |
40-
opm install opm
41-
opm install --dev
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
427

43-
# Запуск тестов и сбор покрытия кода
44-
- name: Покрытие кода
45-
run: oscript ./tasks/coverage.os true
46-
47-
- name: Compute branch name
48-
uses: nixel2007/branch-name@v3
49-
50-
- name: Извлечение версии пакета
51-
shell: bash
52-
run: echo "##[set-output name=version;]`cat packagedef | grep ".Версия(" | sed 's|[^"]*"||' | sed -r 's/".+//'`"
53-
id: extract_version
54-
55-
- name: Установка Sonar-scanner
56-
uses: warchant/setup-sonar-scanner@v1
57-
58-
# Анализ проекта в SonarQube (ветка)
59-
- name: Анализ в SonarQube (branch)
60-
if: github.event_name == 'push'
61-
run: sonar-scanner
62-
-Dsonar.login=${{ secrets.SONARQUBE_TOKEN }}
63-
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
64-
-Dsonar.branch.name=${{ steps.extract_branch.outputs.branch }}
65-
-Dsonar.projectVersion=${{ steps.extract_version.outputs.version }}
66-
67-
# Анализ проекта в SonarQube (PR)
68-
# https://docs.sonarqube.org/latest/analysis/pull-request/
69-
- name: Анализ в SonarQube (pull-request)
70-
if: github.event_name == 'pull_request'
71-
run: sonar-scanner
72-
-Dsonar.login=${{ secrets.SONARQUBE_TOKEN }}
73-
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
74-
-Dsonar.branch.name=${{ steps.extract_branch.outputs.branch }}
75-
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
76-
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
77-
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }}
78-
-Dsonar.scm.revision=${{ github.event.pull_request.head.sha }}
8+
jobs:
9+
sonar:
10+
uses: autumn-library/workflows/.github/workflows/sonar.yml@main
11+
with:
12+
github_repository: oscript-library/gitsync
13+
secrets:
14+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

0 commit comments

Comments
 (0)