Skip to content

Commit 0cad640

Browse files
authored
Update qa.yml
1 parent d06755a commit 0cad640

File tree

1 file changed

+11
-79
lines changed

1 file changed

+11
-79
lines changed

.github/workflows/qa.yml

Lines changed: 11 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +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/configor'
11-
runs-on: ${{ matrix.os }}
12-
strategy:
13-
fail-fast: false
14-
matrix:
15-
os: [ubuntu-latest]
16-
oscript_version: ['1.8.3']
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-
uses: otymko/setup-onescript@v1.0
32-
env:
33-
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
34-
with:
35-
version: ${{ matrix.oscript_version }}
362

37-
# Установка зависимостей пакета
38-
- name: Установка зависимостей
39-
run: |
40-
opm install opm
41-
opm install --dev
42-
opm install 1testrunner
43-
opm install 1bdd
44-
opm install notify
45-
opm install coverage
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
467

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

0 commit comments

Comments
 (0)