-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
467 additions
and
290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# MIT License | ||
# Copyright (C) 2020 Tymko Oleg <olegtymko@yandex.ru> and contributors | ||
# All rights reserved. | ||
|
||
name: Контроль качества | ||
# Любой пуш и pr в проекте но с фильтром по основному проекту | ||
on: [push, pull_request] | ||
jobs: | ||
build: | ||
if: github.repository == 'khorevaa/gitsync-plugins' | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
oscript_version: ['1.4.0', '1.5.0'] | ||
|
||
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/setup-onescript@v1.0 | ||
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@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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# MIT License | ||
# Copyright (C) 2020 Tymko Oleg <olegtymko@yandex.ru> and contributors | ||
# All rights reserved. | ||
|
||
name: Подготовка релиза и публикация в хабе | ||
# Только события создания и изменения релиза | ||
on: | ||
release: | ||
types: [published, edited] | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
oscript_version: ['1.4.0'] | ||
package_mask: ["gitsync-plugins-*.ospx"] | ||
|
||
steps: | ||
# Загрузка проекта | ||
- name: Актуализация | ||
uses: actions/checkout@v2 | ||
|
||
# Установка OneScript конкретной версии | ||
- name: Установка OneScript | ||
env: | ||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | ||
uses: otymko/setup-onescript@v1.0 | ||
with: | ||
version: ${{ matrix.oscript_version }} | ||
|
||
# Установка зависимостей пакета | ||
- name: Установка зависимостей | ||
run: | | ||
opm install opm | ||
opm install | ||
- name: Сборка пакета | ||
run: opm build | ||
|
||
- name: Заливка артифактов | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: package.zip | ||
path: ./${{ matrix.package_mask }} | ||
|
||
- name: Заливка в релиз | ||
uses: AButler/upload-release-assets@v1.0 | ||
with: | ||
files: ./${{ matrix.package_mask }} | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Публикация в hub.oscript.io | ||
shell: bash | ||
run: opm push -f ./${{ matrix.package_mask }} --token ${{ env.TOKEN }} -c stable | ||
env: | ||
TOKEN: ${{ secrets.ACCESS_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# MIT License | ||
# Copyright (C) 2020 Tymko Oleg <olegtymko@yandex.ru> and contributors | ||
# All rights reserved. | ||
|
||
name: Тестирование | ||
# Любой пуш и pr в проекте | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
oscript_version: ['1.4.0', '1.5.0'] | ||
|
||
steps: | ||
# Загрузка проекта | ||
- name: Актуализация | ||
uses: actions/checkout@v2 | ||
|
||
# Установка OneScript конкретной версии | ||
- name: Установка OneScript | ||
env: | ||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | ||
uses: otymko/setup-onescript@v1.0 | ||
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: Тестирование Unit | ||
run: oscript ./tasks/test.os true | ||
|
||
# - name: Тестирование Integrated | ||
# run: | | ||
# docker run -e OSCRIPT_VERSION=${{ matrix.oscript_version }} -v $(pwd):/work_dir harmit/ci-image sh -c 'cd /work_dir; sh /work_dir/travis-ci.sh; exit' | ||
# grep 'Результат прогона тестов <Да>' /tmp/test.log |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.