Skip to content

Commit e627fd6

Browse files
authored
Merge pull request #21 from sfaqer/bugfix/gaTests
Исправление ошибок и параметризация версии ovm
2 parents 79159af + f23c13e commit e627fd6

File tree

5 files changed

+44
-6
lines changed

5 files changed

+44
-6
lines changed

.github/workflows/check.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
oscript_version: [1.3.0, 1.5.0, 1.8.1] # fixme вернуть dev
11+
oscript_version: [lts, stable, dev]
1212
os: [macOS-latest, ubuntu-latest, windows-latest]
13+
ovm_version: ['1.2.1', latest]
1314
name: check oscript
14-
steps:
15+
steps:
1516
- uses: actions/checkout@v2
1617
- uses: ./
1718
with:
1819
version: ${{ matrix.oscript_version }}
20+
ovm_version: ${{ matrix.ovm_version }}
1921
- name: Проверка скрипта OS
2022
run: oscript test/fixtures/test.os
2123
- name: Проверка установки coverage

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,22 @@ Setup-Onescript позволяет использовать в действия
2020
* 1.0.21
2121
* 1.2.0
2222
* 1.3.0
23+
* lts (версия длительного сопровождения)
24+
* stable (последняя выпущенная версия)
2325
* dev (текущая ночная сборка)
26+
* preview (версия для ознакомления)
27+
* lts-dev (версия готовящаяся к выходу в stable)
28+
29+
Так же есть необязательный параметр `ovm_version`
30+
```yaml
31+
with:
32+
ovm_version: 1.2.1 # Требуемая версия OVM
33+
```
34+
Он отвечает за то какая версия OVM будет использоваться для установки, поддерживает следующие значения:
35+
* 1.1.0
36+
* 1.2.0
37+
* 1.2.1
38+
* latest (последний выпущенный релиз OVM)
2439

2540
### Использование matrix
2641

action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ author: 'otymko'
77
inputs:
88
version:
99
description: 'Version of Onescript to use. Support value: 1.3.0, 1.5.0, 1.8.1, dev'
10+
required: true
11+
ovm_version:
12+
description: 'Version of Onescript manager to use. Support value: 1.1.0, 1.2.0, latest'
13+
required: false
14+
default: 'latest'
1015
runs:
1116
using: 'node12'
1217
main: 'dist/index.js'

dist/index.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8657,6 +8657,7 @@ async function run() {
86578657
try {
86588658

86598659
const osVersion = core.getInput('version');
8660+
const ovmVersion = core.getInput('ovm_version');
86608661

86618662
console.log('OS: ' + platform);
86628663

@@ -8672,7 +8673,12 @@ async function run() {
86728673
if (platform == 'win32') {
86738674
pathToOVM = path.dirname(__dirname) + '/' + 'ovm.exe';
86748675
}
8675-
await exec.exec('curl -L https://github.com/oscript-library/ovm/releases/download/v1.2.0/ovm.exe --output ' + pathToOVM);
8676+
8677+
if (ovmVersion == 'latest') {
8678+
await exec.exec('curl -L https://github.com/oscript-library/ovm/releases/latest/download/ovm.exe --output ' + pathToOVM);
8679+
} else {
8680+
await exec.exec('curl -L https://github.com/oscript-library/ovm/releases/download/v'+ ovmVersion + '/ovm.exe --output ' + pathToOVM);
8681+
}
86768682

86778683
if (platform == 'win32') {
86788684
let pathToOVM = path.dirname(__dirname);
@@ -8703,7 +8709,9 @@ async function run() {
87038709
const options = {};
87048710
options.listeners = {
87058711
stdout: (data) => {
8706-
output += data.toString();
8712+
if (data.toString().includes('ovm')) {
8713+
output += data.toString();
8714+
}
87078715
}
87088716
};
87098717
await exec.exec('ovm', ['which', 'current'], options);

index.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ async function run() {
1111
try {
1212

1313
const osVersion = core.getInput('version');
14+
const ovmVersion = core.getInput('ovm_version');
1415

1516
console.log('OS: ' + platform);
1617

@@ -26,7 +27,12 @@ async function run() {
2627
if (platform == 'win32') {
2728
pathToOVM = path.dirname(__dirname) + '/' + 'ovm.exe';
2829
}
29-
await exec.exec('curl -L https://github.com/oscript-library/ovm/releases/download/v1.2.0/ovm.exe --output ' + pathToOVM);
30+
31+
if (ovmVersion == 'latest') {
32+
await exec.exec('curl -L https://github.com/oscript-library/ovm/releases/latest/download/ovm.exe --output ' + pathToOVM);
33+
} else {
34+
await exec.exec('curl -L https://github.com/oscript-library/ovm/releases/download/v'+ ovmVersion + '/ovm.exe --output ' + pathToOVM);
35+
}
3036

3137
if (platform == 'win32') {
3238
let pathToOVM = path.dirname(__dirname);
@@ -57,7 +63,9 @@ async function run() {
5763
const options = {};
5864
options.listeners = {
5965
stdout: (data) => {
60-
output += data.toString();
66+
if (data.toString().includes('ovm')) {
67+
output += data.toString();
68+
}
6169
}
6270
};
6371
await exec.exec('ovm', ['which', 'current'], options);

0 commit comments

Comments
 (0)