Skip to content

Merge pull request #34 from oscript-library/develop #38

Merge pull request #34 from oscript-library/develop

Merge pull request #34 from oscript-library/develop #38

Workflow file for this run

# MIT License
# Copyright (C) 2020 Tymko Oleg <[email protected]> and contributors
# All rights reserved.
name: Контроль качества
# Любой пуш и pr в проекте но с фильтром по основному проекту
on: [push, pull_request]
jobs:
build:
if: github.repository == 'oscript-library/configor'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
oscript_version: ['1.8.3']
steps:
# Загрузка проекта
- name: Актуализация
uses: actions/checkout@v2
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
- name: Извлечение имени текущей ветки
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
# Установка OneScript конкретной версии
- name: Установка OneScript
uses: otymko/[email protected]
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
with:
version: ${{ matrix.oscript_version }}
# Установка зависимостей пакета
- name: Установка зависимостей
run: |
opm install opm
opm install --dev
opm install 1testrunner
opm install 1bdd
opm install notify
opm install coverage
# Запуск тестов и сбор покрытия кода
- name: Покрытие кода
run: oscript ./tasks/coverage.os true
- name: Извлечение версии пакета
shell: bash
run: echo "##[set-output name=version;]`cat packagedef | grep ".Версия(" | sed 's|[^"]*"||' | sed -r 's/".+//'`"
id: extract_version
- name: Установка Sonar-scanner
uses: warchant/setup-sonar-scanner@v3
# Анализ проекта в 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=${{ steps.extract_branch.outputs.branch }}
-Dsonar.projectVersion=${{ steps.extract_version.outputs.version }}
# Анализ проекта в SonarQube (PR)
# https://docs.sonarqube.org/latest/analysis/pull-request/
- 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 }}