Skip to content

Suban05/element-ci-action

Repository files navigation

Element-ci-action

rake Test Coverage Hits-of-Code License

GitHub Action for automating CI processes in the cloud-based development system 1C:Enterprise.Element.

Limitations

Before committing, you must build the project using F9 in the 1C:Element IDE.
Currently, the control panel API does not support project builds, so this must be done manually.

Usage Example

name: CI

on:
  push:
    branches:
      - main

jobs:
  CI:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - name: Run CI
        uses: Suban05/[email protected]
        with:
          config: |
            version: 7.0.5-57
            project_id: ${{ vars.PROJECT }}
            login: ${{ secrets.LOGIN }}
            password: ${{ secrets.PASSWORD }}
            branch: ${{ github.ref_name }}
            actions:
              -
                name: Tests
                title: Run tests
                method: post
                path: tests

Arguments

The input parameter config must contain a YAML configuration.

Field Description Required
version 1C:Element version
project_id Project identifier in the control panel
login Client ID from the control panel access key
password Client secret from the control panel access key
branch Repository branch
head_ref Set if you want to trigger the workflow for a PR
actions (optional) YAML array with HTTP endpoint requests within the application

Example actions

actions:
  - name: Tests
    title: Run tests
    method: post
    path: tests
  • name: system name
  • title: log display message
  • method: HTTP method (get, post)
  • path: endpoint path in the application (e.g., tests)

Workflow

  1. A new application is created from the project.
  2. If actions are defined — requests are sent to the endpoints.
  3. If all responses are 200, the process completes successfully.
  4. If any step returns a status code other than 200, the CI will fail. The application will be deleted in any case to avoid cluttering the application list.

How to Contribute

To test this action, simply run the following commands (assumes Ruby 3+ is installed on your system):

bundle
bundle exec rake

Element-ci-action (Russian)

GitHub Action для автоматизации CI-процессов в облачной системе разработки 1С:Предприятие.Элемент.

Ограничения

Перед коммитом нужно обязательно сделать сборку проекта через F9 в IDE 1С:Элемент. На текущий момент API панели управления не позволяет делать сборки проекта, поэтому это приходится делать вручную.

Пример использования

name: CI

on:
  push:
    branches:
      - main

jobs:
  CI:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - name: Run CI
        uses: Suban05/[email protected]
        with:
          config: |
            version: 7.0.5-57
            project_id: ${{ vars.PROJECT }}
            login: ${{ secrets.LOGIN }}
            password: ${{ secrets.PASSWORD }}
            branch: ${{ github.ref_name }}
            actions:
              -
                name: Tests
                title: Run tests
                method: post
                path: tests

Аргументы

Входной параметр config должен содержать YAML-конфигурацию.

Поле Описание Обязательно
version Версия 1С:Элемент
project_id Идентификатор проекта в панели управления
login Client id из ключа доступа панели управления
password Client secret из ключа доступа панели управления
branch Ветка репозитория
head_ref Заполняется, если необходим запуск workflow для PR
actions (опционально) YAML-массив с запросами к HTTP-эндпоинтам внутри приложения

Пример actions

actions:
  - name: Tests
    title: Run tests
    method: post
    path: tests
  • name: системное имя
  • title: отображаемое сообщение в логах
  • method: HTTP-метод (get, post)
  • path: путь к эндпоинту в приложении (например, tests)

Сценарий

  1. Создаётся новое приложение из проекта.
  2. При наличии actions — выполняются запросы к эндпоинтам.
  3. Если все ответы — 200, процесс успешно завершается.
  4. Если любой шаг возвращает код, отличный от 200, — CI завершится с ошибкой. При этом, приложение в любом случае удалится, чтобы не засорять список приложений.

Как внести вклад

Чтобы протестировать этот action, просто запустите следующие команды (ожидается, что Ruby 3+ установлен в вашей системе):

bundle
bundle exec rake

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages