Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…sa-runner into develop
  • Loading branch information
artbear committed Sep 16, 2021
2 parents 4c291cb + bab91ea commit c2ca3e4
Show file tree
Hide file tree
Showing 16 changed files with 818 additions and 79 deletions.
122 changes: 122 additions & 0 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# MIT License
# Copyright (C) 2020 Tymko Oleg <[email protected]> and contributors
# All rights reserved.

name: Контроль качества
# Любой пуш и pr в проекте но с фильтром по основному проекту
on: [push, pull_request]

env:
# отключение безопасности установки
ACTIONS_ALLOW_UNSECURE_COMMANDS: true

jobs:
coverage:
if: |
github.repository == 'vanessa-opensource/vanessa-runner' ||
always()
runs-on: self-hosted
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# # os: [ubuntu-latest]
# oscript_version: ['1.4.0']

steps:
# Загрузка проекта
- name: Актуализация
uses: actions/checkout@v2
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0

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

# Установка зависимостей пакета
- name: Установка зависимостей
shell: cmd
run: |
opm install --dev
opm install -l
# run: |
# opm install opm
# opm install add
# opm install --dev

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

- name: Заливка отчетов о покрытии кода
uses: actions/upload-artifact@v2
with:
name: code-coverage-report
path: |
coverage
sonar-analyze:
if: |
github.repository == 'vanessa-opensource/vanessa-runner' ||
always()
runs-on: ubuntu-18.04
needs: coverage
steps:

# Актуализация
- uses: actions/checkout@v2
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0

- name: Получение отчетов о покрытии кода
uses: actions/download-artifact@v2
with:
name: code-coverage-report
path: coverage

- name: Display structure of downloaded files
run: ls -R

- name: Display structure of downloaded files
run: ls -R coverage

# 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

- name: Извлечение версии пакета
shell: bash
run: echo "##[set-output name=version;]`cat src/Модули/ПараметрыСистемы.os | grep "Версия\s*=" | sed 's|[^"]*"||' | sed -r 's/".+//'`"
id: extract_version

- name: Установка Sonar-scanner
uses: warchant/setup-sonar-scanner@v1

# Анализ проекта в SonarQube (ветка)
- name: Анализ в SonarQube (branch)
if: github.event_name == 'push'
run: sonar-scanner
-Dsonar.login=${{ secrets.SONARQUBE_TOKEN }}
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
-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'
run: sonar-scanner
-Dsonar.login=${{ secrets.SONARQUBE_TOKEN }}
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
-Dsonar.branch.name=${{ steps.extract_branch.outputs.branch }}
-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 }}
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# MIT License
# Copyright (C) 2020 Tymko Oleg <[email protected]> and contributors
# All rights reserved.

name: Подготовка релиза и публикация в хабе
# Только события создания и изменения релиза
on:
release:
types: [published, edited]

env:
PACKAGE_MASK: vanessa-runner-*.ospx

jobs:
build:
runs-on: self-hosted
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# os: [ubuntu-latest]
# oscript_version: ['1.4.0']

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

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

# Установка зависимостей пакета
- name: Установка зависимостей
run: |
opm install
# run: |
# opm install opm
# opm install

- name: Сборка пакета
run: opm build

- name: Заливка артефактов
uses: actions/upload-artifact@v2
with:
name: package.zip
path: ./${{ env.PACKAGE_MASK }}

- name: Заливка в релиз
uses: AButler/[email protected]
with:
files: ./${{ env.PACKAGE_MASK }}
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Публикация в hub.oscript.io
shell: cmd
run: opm push -f ./${{ env.PACKAGE_MASK }} --token ${{ env.TOKEN }} -c stable
env:
TOKEN: ${{ secrets.OSHUB_TOKEN }}
46 changes: 46 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# MIT License
# Copyright (C) 2020 Tymko Oleg <[email protected]> and contributors
# All rights reserved.

name: Тестирование
# Любой пуш и pr в проекте
on: [push, pull_request]

jobs:
build:
runs-on: [vanessa]
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# # os: [ubuntu-latest, windows-latest]
# oscript_version: ['1.4.0']

steps:
# Загрузка проекта
- name: Актуализация
uses: actions/checkout@v2
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0

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

# Установка зависимостей пакета
- name: Установка зависимостей
shell: cmd
run: |
opm install --dev
opm install -l
# run: |
# opm install opm
# opm install add
# opm install --dev

# Задача тестирования, в результате ожидается успешное выполнение
- name: Тестирование
run: oscript ./tasks/test.os
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
build/
# Файлы
*.log
*.ospx
oscript_modules/

coverage/stat\.json

bdd-exec\.xml

*.epf

coverage/
**/ConfigDumpInfo.xml
.vscode/launch.json
tools/oscript.cfg
src/oscript.cfg

# Каталоги
build/
oscript_modules/
coverage/
.scannerwork/
allure-report/
10 changes: 10 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
This product contains parts of V8Runner, which is licensed under the Apache License,
Version 2.0.
The license can be downloaded from
http://www.apache.org/licenses/LICENSE-2.0.html.
The source code for this software is available from
https://github.com/oscript-library/v8runner

This product contains parts of oscript-actions-template, which is licensed under the MIT License.
The source code for this software is available from
https://github.com/silverbulleters/oscript-actions-template.git
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
<a id="markdown-автоматизация-повседневных-операций-1с-разработчика" name="автоматизация-повседневных-операций-1с-разработчика"></a>
# Автоматизация повседневных операций 1С разработчика

[![Статус Порога Качества](https://sonar.openbsl.ru/api/project_badges/measure?project=vanessa-runner&metric=alert_status)](https://sonar.openbsl.ru/dashboard?id=vanessa-runner) [![Покрытие](https://sonar.openbsl.ru/api/project_badges/measure?project=vanessa-runner&metric=coverage)](https://sonar.openbsl.ru/dashboard?id=vanessa-runner) [![Строки кода](https://sonar.openbsl.ru/api/project_badges/measure?project=vanessa-runner&metric=ncloc)](https://sonar.openbsl.ru/dashboard?id=vanessa-runner)
[![Chat on Telegram vanessa_opensource_chat](https://img.shields.io/badge/chat-Telegram-brightgreen.svg)](https://t.me/vanessa_opensource_chat)
[![GitHub release](https://img.shields.io/github/release/vanessa-opensource/vanessa-runner.svg)](https://github.com/vanessa-opensource/vanessa-runner/releases)
[![Тестирование](https://github.com/vanessa-opensource/vanessa-runner/actions/workflows/testing.yml/badge.svg)](https://github.com/vanessa-opensource/vanessa-runner/actions/workflows/testing.yml)
[![Статус Порога Качества](https://sonar.openbsl.ru/api/project_badges/measure?project=vanessa-runner&metric=alert_status)](https://sonar.openbsl.ru/dashboard?id=vanessa-runner)
[![Покрытие](https://sonar.openbsl.ru/api/project_badges/measure?project=vanessa-runner&metric=coverage)](https://sonar.openbsl.ru/dashboard?id=vanessa-runner)
[![Технический долг](https://sonar.openbsl.ru/api/project_badges/measure?project=vanessa-runner&metric=sqale_index)](https://sonar.openbsl.ru/dashboard?id=vanessa-runner)
[![Строки кода](https://sonar.openbsl.ru/api/project_badges/measure?project=vanessa-runner&metric=ncloc)](https://sonar.openbsl.ru/dashboard?id=vanessa-runner)

<!-- [![Статус Порога Качества](https://sonar.openbsl.ru/api/project_badges/measure?project=vanessa-runner&metric=alert_status)](https://sonar.openbsl.ru/dashboard?id=vanessa-runner) [![Покрытие](https://sonar.openbsl.ru/api/project_badges/measure?project=vanessa-runner&metric=coverage)](https://sonar.openbsl.ru/dashboard?id=vanessa-runner) [![Строки кода](https://sonar.openbsl.ru/api/project_badges/measure?project=vanessa-runner&metric=ncloc)](https://sonar.openbsl.ru/dashboard?id=vanessa-runner) -->

<!-- TOC -->

Expand Down
Loading

0 comments on commit c2ca3e4

Please sign in to comment.