Skip to content

Commit e836233

Browse files
authored
Merge pull request #186 from ovcharenko-di/feature/GA
переезд на GA
2 parents 6fd35f1 + 62486c9 commit e836233

File tree

6 files changed

+92
-133
lines changed

6 files changed

+92
-133
lines changed

.github/workflows/main.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
# * is a special character in YAML so you have to quote this string
8+
- cron: '0 0 * * 1'
9+
10+
jobs:
11+
build:
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [ubuntu-latest, windows-latest, macos-latest]
17+
oscript_version: ['1.2.0', 'dev', 'stable']
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: Setup Onescript Action
23+
uses: otymko/setup-onescript@v1.0
24+
with:
25+
version: ${{ matrix.oscript_version }}
26+
27+
- name: Install dependencies
28+
run: |
29+
opm install opm@1.0.2
30+
opm install 1testrunner;
31+
opm install 1bdd;
32+
opm install coverage;
33+
opm install -l --dev
34+
35+
- name: Configure env vars for SonarCloud scan
36+
run: |
37+
echo "::set-env name=PATH::/opt/sonar-scanner/bin:$PATH"
38+
39+
- name: Compute branch name
40+
uses: nixel2007/branch-name@v3
41+
42+
- name: Run tests
43+
run: |
44+
oscript ./tasks/coverage.os
45+
46+
- name: SonarCloud Scan on push
47+
if: github.repository == 'oscript-library/opm' && github.event_name == 'push' && matrix.os == 'ubuntu-latest' && matrix.oscript_version == 'dev'
48+
uses: nixel2007/sonarcloud-github-action@v1.4
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
52+
with:
53+
args: >
54+
-Dsonar.host.url=https://sonar.openbsl.ru
55+
-Dsonar.branch.name=${{ env.BRANCH_NAME }}
56+
57+
- name: SonarCloud Scan on PR
58+
if: github.repository == 'oscript-library/opm' && github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest' && matrix.oscript_version == 'dev'
59+
uses: nixel2007/sonarcloud-github-action@v1.4
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
63+
with:
64+
args: >
65+
-Dsonar.host.url=https://sonar.openbsl.ru
66+
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
67+
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
68+
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }}
69+
-Dsonar.scm.revision=${{ github.event.pull_request.head.sha }}

.travis.yml

Lines changed: 0 additions & 77 deletions
This file was deleted.

sonar-project.properties

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# must be unique in a given SonarQube instance
2+
sonar.projectKey=opm
3+
4+
# this is the name displayed in the SonarQube UI
5+
sonar.projectName=opm
6+
7+
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
8+
# Since SonarQube 4.2, this property is optional if sonar.modules is set.
9+
# If not set, SonarQube starts looking for source code from the directory containing
10+
# the sonar-project.properties file.
11+
12+
sonar.sources=./src
13+
sonar.tests=./tests
14+
15+
# Encoding of the source code. Default is default system encoding
16+
sonar.sourceEncoding=UTF-8
17+
18+
sonar.coverageReportPaths=./coverage/genericCoverage.xml
19+
sonar.testExecutionReportPaths=./coverage/coverage.xml

sonar-qube.sh

Lines changed: 0 additions & 22 deletions
This file was deleted.

tasks/coverage.os

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,21 @@
22
#Использовать 1commands
33
#Использовать fs
44

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

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

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

17-
Файл_Стат = Новый Файл(ПутьКСтат);
18-
19-
ИмяПакета = "opm";
20-
2114
ПроцессорГенерации = Новый ГенераторОтчетаПокрытия();
2215

2316
ПроцессорГенерации.ОтносительныеПути()
24-
.ФайлСтатистики(Файл_Стат.ПолноеИмя)
17+
.ИмяФайлаСтатистики()
2518
.GenericCoverage()
2619
.Cobertura()
27-
.Clover(ИмяПакета)
2820
.Сформировать();
2921

30-
ЗавершитьРаботу(КодВозврата);
22+
ЗавершитьРаботу(КодВозврата);

travis-ci.sh

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)