GitHub Action for automating CI processes in the cloud-based development system 1C:Enterprise.Element.
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.
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: testsThe 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 | ❌ |
actions:
- name: Tests
title: Run tests
method: post
path: testsname: system nametitle: log display messagemethod: HTTP method (get,post)path: endpoint path in the application (e.g.,tests)
- A new application is created from the project.
- If
actionsare defined — requests are sent to the endpoints. - If all responses are 200, the process completes successfully.
- 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.
To test this action, simply run the following commands (assumes Ruby 3+ is installed on your system):
bundle
bundle exec rakeGitHub 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:
- name: Tests
title: Run tests
method: post
path: testsname: системное имяtitle: отображаемое сообщение в логахmethod: HTTP-метод (get,post)path: путь к эндпоинту в приложении (например,tests)
- Создаётся новое приложение из проекта.
- При наличии
actions— выполняются запросы к эндпоинтам. - Если все ответы — 200, процесс успешно завершается.
- Если любой шаг возвращает код, отличный от 200, — CI завершится с ошибкой. При этом, приложение в любом случае удалится, чтобы не засорять список приложений.
Чтобы протестировать этот action, просто запустите следующие команды (ожидается, что Ruby 3+ установлен в вашей системе):
bundle
bundle exec rake