Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Переезд на workflows для qa #79

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 12 additions & 71 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
@@ -1,74 +1,15 @@
# 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 == 'autumn-library/autumn') && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.event.repository.full_name)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
oscript_version: ['lts-dev']

steps:
# Загрузка проекта
- name: Актуализация
uses: actions/checkout@v2

# Вычисление имени ветки
- name: Compute branch name
uses: nelonoel/[email protected]

# Установка OneScript конкретной версии
- name: Установка OneScript
uses: otymko/[email protected]
with:
version: ${{ matrix.oscript_version }}

# Установка зависимостей пакета
- name: Установка зависимостей
run: |
opm install opm
opm install -l --dev
on:
push:
pull_request:
workflow_dispatch:

# Запуск тестов и сбор покрытия кода
- name: Покрытие кода
run: oscript ./tasks/coverage.os

- name: Извлечение версии пакета
shell: bash
run: echo "##[set-output name=version;]`cat packagedef | grep ".Версия(" | sed 's|[^"]*"||' | sed -r 's/".+//'`"
id: extract_version

- name: Setup sonarqube
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=${{ env.BRANCH_NAME }}
-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 }}
jobs:
sonar:
uses: autumn-library/workflows/.github/workflows/sonar.yml@main
with:
github_repository: autumn-library/autumn
oscript_version: lts-dev
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Loading