Skip to content
Open
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
17 changes: 17 additions & 0 deletions .github/actions/extract-version/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Извлечение версии
description: Извлечение версии из исходников
inputs:
path:
description: 'Путь к исходникам'
required: true
outputs:
version:
description: 'Версия'
value: ${{ steps.extract_version.outputs.version }}
runs:
using: "composite"
steps:
- name: Извлечение версии
shell: bash
run: echo "version=$(cat ${{ inputs.path }}/Configuration/Configuration.mdo | grep -oP '(?<=<version>)[\d.]+')" >> $GITHUB_OUTPUT
id: extract_version
18 changes: 18 additions & 0 deletions .github/actions/load-extension/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Загрузка расширения
description: Загрузка расширения в информационную базу с использованием ibcmd
inputs:
name:
description: 'Имя загружаемого расширения'
required: true
path:
description: 'Путь к файлу расширения'
required: true
runs:
using: "composite"
steps:
- name: Загрузка расширения ${{inputs.name}}
shell: bash
run: |
ibcmd infobase config load --db-path=file-db --extension=${{inputs.name}} --force ${{inputs.path}}
ibcmd infobase config apply --db-path=file-db --extension=${{inputs.name}} --force
ibcmd infobase config extension update --db-path=file-db --name=${{inputs.name}} --safe-mode=no --unsafe-action-protection=no
67 changes: 67 additions & 0 deletions .github/workflows/perform-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Тестирование
on:
push:
branches:
- feature/**
- develop
paths:
- '.github/workflows/**'
- 'exts/**'
- 'tests/**'
- 'fixtures/**'

pull_request_target:
branches: [ develop ]
paths:
- '.github/workflows/**'
- 'exts/**'
- 'tests/**'
- 'fixtures/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.number }}-main
cancel-in-progress: true

permissions:
contents: write
checks: write
id-token: write

jobs:
export_to_designer:
name: Конвертация исходников
uses: ./.github/workflows/step-export-xml.yml
with:
edt_version: 2023.1.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нужно 2024 актуальную взять

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Помнится были какие-то проблемы с новой версией в gh actions

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

надо на edt cli переписать c ring

artifact_name: designer-src
secrets: inherit

build_artifacts:
name: Сборка
uses: ./.github/workflows/step-build-artifacts-windows.yml
needs: export_to_designer
with:
v8_version: 8.3.21.1895
secrets: inherit

tests:
name: Тест
strategy:
fail-fast: false
matrix:
version:
- 8.3.21.1895
locale:
- ru_RU
- en_US
os:
- windows-latest
- ubuntu-22.04

uses: ./.github/workflows/step-run-tests.yml
needs: build_artifacts
with:
v8_version: ${{ matrix.version }}
locale: ${{ matrix.locale }}
os: ${{ matrix.os }}
secrets: inherit
85 changes: 85 additions & 0 deletions .github/workflows/step-build-artifacts-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Сборка артефактов
on:
workflow_call:
inputs:
v8_version:
type: string
required: true

src_artifact_name:
type: string
required: false
default: designer-src

artifact_name:
type: string
required: false
default: build-artifacts

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.number }}-build
cancel-in-progress: true

jobs:
build:
name: Сборка
runs-on: windows-latest
defaults:
run:
shell: pwsh
steps:

- name: Установка 1С:Предприятие
uses: 1CDevFlow/onec-setup-action@main
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

я соглашусь с замечаниями кролика, лучше использовать явную версию

with:
type: onec
onec_version: ${{ inputs.v8_version }}
cache: true
env:
ONEC_USERNAME: ${{ secrets.ONEC_USERNAME }}
ONEC_PASSWORD: ${{ secrets.ONEC_PASSWORD }}
timeout-minutes: 10

- name: Загрузка исходников в формате конфигуратора
uses: actions/download-artifact@v4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

экшен с депендаботом нужно подключить, для обновления зависимостей GA

with:
name: ${{ inputs.src_artifact_name }}

- name: Распаковка исходников
run: |
mkdir export
mkdir binary
cd export
7z x ../export.7z -y

- name: Создание информационной базы
run: ibcmd infobase create --db-path=file-db --import=export\configuration --apply --force
timeout-minutes: 5

- name: Импорт rat из исходников
run: ibcmd infobase config import --db-path=file-db --extension=RAT export\rat
timeout-minutes: 5

- name: Импорт тестов из исходников
run: ibcmd infobase config import --db-path=file-db --extension=tests export\tests
timeout-minutes: 5

- name: Сохрание расширения rat
run: ibcmd infobase config save --db-path=file-db --extension=RAT binary\rat.cfe
timeout-minutes: 5

- name: Сохрание расширения с тестами
run: ibcmd infobase config save --db-path=file-db --extension=tests binary\tests.cfe
timeout-minutes: 5

- name: Сохрание тестовой конфигурации
run: ibcmd infobase config save --db-path=file-db binary\configuration.cf
timeout-minutes: 5

- name: Публикация артефактов
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact_name }}
path: binary\*.*
if-no-files-found: error
retention-days: 1
99 changes: 99 additions & 0 deletions .github/workflows/step-export-xml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Конвертация исходников в формат конфигуратора
on:
workflow_call:
inputs:
edt_version:
type: string
required: true

artifact_name:
type: string
required: true

engine_only:
type: boolean
required: false
default: false
outputs:
rat_version:
value: ${{ jobs.export.outputs.rat_version }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.number }}-export
cancel-in-progress: true

jobs:
export:
name: Конвертация
runs-on: ubuntu-22.04
outputs:
rat_version: ${{ steps.extract_version.outputs.version }}

steps:
- name: Извлечение исходников PR
if: github.event_name == 'pull_request_target' || github.event_name == 'pull_request'
uses: actions/checkout@v4
with:
ref: refs/pull/${{ github.event.number }}/merge # Для поддержки pull_request и pull_request_target

- name: Извлечение исходников ветки ${{ github.ref_name }}
if: github.event_name == 'push'
uses: actions/checkout@v4

- name: Извлечение версии rat
uses: ./.github/actions/extract-version
with:
path: ./exts/rat/src
id: extract_version

- name: Установка 1C:EDT
uses: 1CDevFlow/onec-setup-action@main
with:
type: edt
edt_version: ${{ inputs.edt_version }}
cache: true
env:
ONEC_USERNAME: ${{ secrets.ONEC_USERNAME }}
ONEC_PASSWORD: ${{ secrets.ONEC_PASSWORD }}
timeout-minutes: 30

- name: Ковертация исходников конфигурации
if: ${{ !inputs.engine_only }}
uses: alkoleft/onec-edtcli-command-action@main
with:
export: true
from: fixtures/configuration
to: export/configuration
timeout: 15
timeout-minutes: 15

- name: Ковертация исходников тестов
uses: alkoleft/onec-edtcli-command-action@main
with:
export: true
from: exts/rat
to: export/rat
timeout: 15
timeout-minutes: 15

- name: Ковертация исходников тестов
uses: alkoleft/onec-edtcli-command-action@main
with:
export: true
from: tests
to: export/tests
timeout: 15
timeout-minutes: 15

- name: Упаковка исходников в архив
run: |
cd export
7za a -t7z ../export.7z ./

- name: Публикация исходников в формате конфигуратора
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact_name }}
path: export.7z
if-no-files-found: error
retention-days: 1
Loading