-
Notifications
You must be signed in to change notification settings - Fork 54
169 lines (143 loc) · 5.57 KB
/
step-run-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: Тестирование
on:
workflow_call:
inputs:
v8_version:
description: 'Версия 1С:Предприятие'
type: string
required: true
locale:
type: string
required: false
default: ru_RU
artifact_name:
type: string
required: false
default: build-artifacts
fail_on_failure:
type: boolean
required: false
default: true
os:
type: string
required: true
permissions:
contents: read
checks: write
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ inputs.v8_version }}-${{ inputs.locale }}-${{ github.event.number }}-${{inputs.os}}
cancel-in-progress: true
jobs:
execute-tests:
name: Тестирование
runs-on: ${{inputs.os}}
steps:
- name: Загрузка артифактов
uses: actions/download-artifact@v4
with:
name: ${{ inputs.artifact_name }}
path: binary
- name: Подготовка окружения (Linux)
if: runner.os == 'Linux'
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y locales
sudo ln -s /usr/lib/x86_64-linux-gnu/libenchant-2.so.2 /usr/lib/libenchant.so.1
sudo localedef -i ${{ inputs.locale }} -c -f UTF-8 -A /usr/share/locale/locale.alias ${{ inputs.locale }}.UTF-8
mkdir -p ~/.1cv8/1C/1cv8/conf/
echo "DisableUnsafeActionProtection=.*" >>~/.1cv8/1C/1cv8/conf/conf.cfg
- name: Подготовка окружения (Windows)
if: runner.os == 'Windows'
run: |
mkdir -p "C:\Program Files\1cv8\conf"
"DisableUnsafeActionProtection=.*" | Out-File -FilePath "C:\Program Files\1cv8\conf\conf.cfg" -Encoding utf8 -Append
- name: Определение "короткой" локали
id: short_locale
shell: pwsh
run: |
Write-Output "substring=$('${{ inputs.locale }}'.Substring(0, 2))" >> $Env:GITHUB_OUTPUT
- name: Установка 1С:Предприятие
uses: 1CDevFlow/onec-setup-action@main
with:
type: onec
onec_version: ${{ inputs.v8_version }}
cache: ${{runner.os == 'Windows'}}
env:
ONEC_USERNAME: ${{ secrets.ONEC_USERNAME }}
ONEC_PASSWORD: ${{ secrets.ONEC_PASSWORD }}
timeout-minutes: 10
- name: Создание информационной базы
shell: bash
run: |
ibcmd infobase create --db-path=file-db --load=binary/configuration.cf --apply --force
timeout-minutes: 5
- name: Загрузка расширения c тестами
uses: 1CDevFlow/workflows/actions/load-extension@main
with:
name: tests
path: binary/tests.cfe
- name: Загрузка расширения c дымовыми тестами
uses: 1CDevFlow/workflows/actions/load-extension@main
with:
name: Smoke
path: binary/smoke.cfe
- name: Загрузка расширения YAxUnit
uses: 1CDevFlow/workflows/actions/load-extension@main
with:
name: YAXUNIT
path: binary/yaxunit.cfe
- name: Создание файла конфигурации тестирования
uses: DamianReeves/write-file-action@master
with:
path: yaxunit-config.json
contents: |
{
"reportFormat": "jUnit",
"reportPath": "report.xml",
"closeAfterTests": true,
"exitCode": "exit-code.txt",
"logging": {
"console": true,
"file": "log.txt"
}
}
- name: Запуск тестирования (Linux)
if: runner.os == 'Linux'
uses: coactions/setup-xvfb@v1
with:
run: |
ibsrv --db-path=file-db --daemon
1cv8c /WS "http://localhost:8314" /C"RunUnitTests=yaxunit-config.json" /L ${{ steps.short_locale.outputs.substring }} /VL ${{ inputs.locale }} /DisableStartupDialogs /DisableStartupMessages /DisableUnrecoverableErrorMessage /Out output.log
env:
LANG: "${{ inputs.locale }}.UTF-8"
timeout-minutes: 10
- name: Запуск тестирования (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
Start-Process ibsrv.exe -ArgumentList "--db-path=file-db"
Start-Process -NoNewWindow -PassThru -Wait 1cv8c.exe -ArgumentList '/WS "http://localhost:8314" /C"RunUnitTests=yaxunit-config.json" /L ${{ steps.short_locale.outputs.substring }} /VL ${{ inputs.locale }} /DisableStartupDialogs /DisableStartupMessages /DisableUnrecoverableErrorMessage /Out 1cv8c-output.log'
timeout-minutes: 10
- name: Сохранение файла отчета
uses: actions/upload-artifact@v4
if: always()
with:
name: Отчет о тестировании. ${{runner.os}} ${{ inputs.v8_version }} ${{ inputs.locale }}
path: report.xml
- name: Публикация отчета о тестировании
uses: 1CDevFlow/action-onec-junit-report@main
if: always()
with:
job_name: Тестирование
check_name: Отчет о тестировании. ${{runner.os}} ${{ inputs.v8_version }} ${{ inputs.locale }}
report_paths: report.xml
fail_on_failure: true
require_passed_tests: true
- name: Лог выполнения
if: always()
continue-on-error: true
run: cat log.txt
- name: Лог платформы
if: always()
run: cat output.log
continue-on-error: true