Skip to content
Merged
Show file tree
Hide file tree
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
69 changes: 69 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: CI

on:
push:
pull_request:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 0 * * 1'

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
oscript_version: ['1.2.0', 'dev', 'stable']

steps:
- uses: actions/checkout@v2

- name: Setup Onescript Action
uses: otymko/setup-onescript@v1.0
with:
version: ${{ matrix.oscript_version }}

- name: Install dependencies
run: |
opm install opm@1.0.2
opm install 1testrunner;
opm install 1bdd;
opm install coverage;
opm install -l --dev

- name: Configure env vars for SonarCloud scan
run: |
echo "::set-env name=PATH::/opt/sonar-scanner/bin:$PATH"

- name: Compute branch name
uses: nixel2007/branch-name@v3

- name: Run tests
run: |
oscript ./tasks/coverage.os

- name: SonarCloud Scan on push
if: github.repository == 'oscript-library/opm' && github.event_name == 'push' && matrix.os == 'ubuntu-latest' && matrix.oscript_version == 'dev'
uses: nixel2007/sonarcloud-github-action@v1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.host.url=https://sonar.openbsl.ru
-Dsonar.branch.name=${{ env.BRANCH_NAME }}

- name: SonarCloud Scan on PR
if: github.repository == 'oscript-library/opm' && github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest' && matrix.oscript_version == 'dev'
uses: nixel2007/sonarcloud-github-action@v1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-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 }}
77 changes: 0 additions & 77 deletions .travis.yml

This file was deleted.

19 changes: 19 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# must be unique in a given SonarQube instance
sonar.projectKey=opm

# this is the name displayed in the SonarQube UI
sonar.projectName=opm

# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
# Since SonarQube 4.2, this property is optional if sonar.modules is set.
# If not set, SonarQube starts looking for source code from the directory containing
# the sonar-project.properties file.

sonar.sources=./src
sonar.tests=./tests

# Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8

sonar.coverageReportPaths=./coverage/genericCoverage.xml
sonar.testExecutionReportPaths=./coverage/coverage.xml
22 changes: 0 additions & 22 deletions sonar-qube.sh

This file was deleted.

16 changes: 4 additions & 12 deletions tasks/coverage.os
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,21 @@
#Использовать 1commands
#Использовать fs

ФС.ОбеспечитьПустойКаталог("coverage");
ПутьКСтат = "coverage/stat.json";
ФС.ОбеспечитьПустойКаталог("coverage"); // TODO: убрать после исправления issue #5 в coverage

Команда = Новый Команда;
Команда.УстановитьКоманду("oscript");
Команда.ДобавитьПараметр("-encoding=utf-8");
Команда.ДобавитьПараметр(СтрШаблон("-codestat=%1", ПутьКСтат));
Команда.ДобавитьПараметр("tasks/test.os");
Команда.ДобавитьПараметр("tasks/test.os"); // Файла запуска тестов
Команда.ПоказыватьВыводНемедленно(Истина);

КодВозврата = Команда.Исполнить();

Файл_Стат = Новый Файл(ПутьКСтат);

ИмяПакета = "opm";

ПроцессорГенерации = Новый ГенераторОтчетаПокрытия();

ПроцессорГенерации.ОтносительныеПути()
.ФайлСтатистики(Файл_Стат.ПолноеИмя)
.ИмяФайлаСтатистики()
.GenericCoverage()
.Cobertura()
.Clover(ИмяПакета)
.Сформировать();

ЗавершитьРаботу(КодВозврата);
ЗавершитьРаботу(КодВозврата);
22 changes: 0 additions & 22 deletions travis-ci.sh

This file was deleted.