Skip to content

[FEAT] Добавлен параметр ibsrv для запуска команд с использование автономного сервера #556

[FEAT] Добавлен параметр ibsrv для запуска команд с использование автономного сервера

[FEAT] Добавлен параметр ibsrv для запуска команд с использование автономного сервера #556

Workflow file for this run

name: Тестирование
on:
push:
pull_request_target:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}
cancel-in-progress: true
permissions:
checks: write
pull-requests: write
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
oscript_version: ['stable']
v8_version: ['8.3.23.1997', '8.3.24.1548', '8.3.25.1445']
os: [ 'windows-latest', 'ubuntu-latest' ]
locale: ['ru_RU']
steps:
- name: Set Russian locale
if: matrix.os == 'windows-latest'
run: |
powershell -Command "Set-WinUILanguageOverride -Language ru-RU"
powershell -Command "Set-WinUserLanguageList ru-RU -Force"
powershell -Command "Set-Culture ru-RU"
powershell -Command "Set-WinSystemLocale ru-RU"
- name: Verify locale settings
if: matrix.os == 'windows-latest'
run: |
powershell -Command "Get-WinUILanguageOverride"
powershell -Command "Get-WinUserLanguageList"
powershell -Command "Get-Culture"
powershell -Command "Get-WinSystemLocale"
- name: Актуализация
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Установка свойств git
shell: bash
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Вычисление версии OneScript
shell: bash
id: extract_oscript_version
run: |
set -ex
if [ "${{ matrix.oscript_version }}" = "default" ]
then
extracted_version=$(cat packagedef | grep ".ВерсияСреды(" | sed 's|[^"]*"||' | sed -r 's/".+//' || true)
version="${extracted_version:-stable}"
else
version="${{ matrix.oscript_version }}"
fi
echo "version=$version" >> $GITHUB_OUTPUT
- name: Установка OneScript
uses: otymko/[email protected]
with:
version: ${{ steps.extract_oscript_version.outputs.version }}
- name: Установка зависимостей
run: |
opm install opm
opm install -l --dev
- name: Установка дополнительных пакетов
run: opm install add
- name: Установка 1С:Предприятие
if: matrix.v8_version != ''
uses: 1CDevFlow/onec-setup-action@main
with:
type: onec # Тип устанавливаемого приложения
onec_version: ${{ matrix.v8_version }}
cache: false
env:
ONEC_USERNAME: ${{ secrets.ONEC_USERNAME }}
ONEC_PASSWORD: ${{ secrets.ONEC_PASSWORD }}
- name: Подготовка окружения (Linux)
if: matrix.v8_version != '' && matrix.os == 'ubuntu-latest'
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y locales libwebkit2gtk-4.0-37
sudo ln -s /usr/lib/x86_64-linux-gnu/libenchant-2.so.2 /usr/lib/libenchant.so.1
sudo localedef -i ${{ matrix.locale }} -c -f UTF-8 -A /usr/share/locale/locale.alias ${{ matrix.locale }}.UTF-8
- name: Установка лицензии (Linux)
if: matrix.v8_version != '' && matrix.os == 'ubuntu-latest'
run: |
# Создание каталога
sudo mkdir -p /var/1C/licenses
# Запись лицензии в файл
echo "${{ secrets.ONEC_LICENCE }}" | sudo tee /var/1C/licenses/licence.lic > /dev/null
# Назначение группы владельца каталога
sudo chown root:grp1cv8 /var/1C/licenses/licence.lic
# Назначение прав
sudo chmod 777 -R /var/1C/licenses
shell: bash
env:
ONEC_LICENCE: ${{ secrets.ONEC_LICENCE }}
- name: Создание файла конфигурации conf.cfg (Linux)
if: matrix.v8_version != '' && matrix.os == 'ubuntu-latest'
run: |
sudo mkdir -p /opt/1cv8/conf/
sudo tee /opt/1cv8/conf/conf.cfg > /dev/null <<EOF
DisableUnsafeActionProtection=.*
SystemLanguage=System
EOF
sudo chown root:grp1cv8 /opt/1cv8/conf/conf.cfg
# Назначение прав
sudo chmod 777 -R /opt/1cv8/conf/
- name: Установка лицензии (Windows)
if: matrix.v8_version != '' && matrix.os == 'windows-latest'
run: |
mkdir "C:\ProgramData\1C\licenses" -Force
echo $Env:ONEC_LICENCE | Out-File -FilePath "C:\ProgramData\1C\licenses\licence.lic" -Encoding ascii
shell: pwsh
env:
ONEC_LICENCE: ${{ secrets.ONEC_LICENCE }}
- name: Создание файла конфигурации conf.cfg (Windows)
if: matrix.v8_version != '' && matrix.os == 'windows-latest'
run: |
New-Item -ItemType Directory -Force -Path "C:\Program Files\1cv8\conf"
Set-Content -Path "C:\Program Files\1cv8\conf\conf.cfg" -Value @'
DisableUnsafeActionProtection=.*
SystemLanguage=System
'@
shell: pwsh
- name: build
uses: coactions/setup-xvfb@v1
continue-on-error: false
with:
run: oscript ./tasks/build.os
- name: Тестирование
uses: coactions/setup-xvfb@v1
continue-on-error: true
with:
run: oscript ./tasks/test.os
- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
with:
report_paths: '**/build/reports/*.xml'
fail_on_failure: true
comment: true
check_name: 'Результаты тестов. ОС: ${{ matrix.os }}. Версия 1С: ${{ matrix.v8_version }}. Версия OneScript: ${{ steps.extract_oscript_version.outputs.version }}'