Skip to content

Commit 2ec82ba

Browse files
Merge pull request #105 from oscript-library/develop
Upd master
2 parents 232f489 + 8a2a213 commit 2ec82ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1164
-579
lines changed

.bsl-language-server.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"$schema": "https://1c-syntax.github.io/bsl-language-server/configuration/schema.json",
3+
"language": "ru",
4+
"diagnostics": {
5+
"parameters": {
6+
"LineLength": {
7+
"maxLineLength": 150
8+
},
9+
"MissingSpace": {
10+
"allowMultipleCommas": true
11+
},
12+
"Typo": {
13+
"minWordLength": 3,
14+
"userWordsToIgnore": "Закоммитить,Коммитом,Коммита,Коммите,тэг,Тэг,Инкрементально,"
15+
}
16+
}
17+
}
18+
}

.github/workflows/qa.yml

Lines changed: 104 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,76 +3,153 @@
33
# All rights reserved.
44

55
name: Контроль качества
6-
# Любой пуш и pr в проекте но с фильтром по основному проекту
7-
on: [push, pull_request]
6+
7+
on:
8+
push:
9+
pull_request_target:
10+
workflow_dispatch:
11+
812
jobs:
9-
build:
10-
if: github.repository == 'khorevaa/gitsync-plugins'
13+
sonar:
14+
if: github.repository == 'oscript-library/gitsync-plugins'
1115
runs-on: ${{ matrix.os }}
1216
strategy:
1317
fail-fast: false
1418
matrix:
15-
os: [ubuntu-latest]
16-
oscript_version: ['1.8.3']
19+
os: [ubuntu-22.04]
20+
oscript_version: ['1.9.2']
21+
v8_version: ['8.3.24.1691']
22+
edt_version: ['2024.2.5']
23+
locale: ['ru_RU']
1724

1825
steps:
19-
# Загрузка проекта
26+
- name: Освобождение места
27+
if: startsWith(matrix.os, 'ubuntu')
28+
uses: easimon/maximize-build-space@master
29+
with:
30+
root-reserve-mb: 20480
31+
swap-size-mb: 1024
32+
remove-android: 'true'
33+
remove-haskell: 'true'
34+
remove-codeql: 'true'
35+
remove-docker-images: 'true'
36+
2037
- name: Актуализация
21-
uses: actions/checkout@v2
38+
uses: actions/checkout@v4.2.2
39+
with:
40+
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
41+
ref: ${{ github.event.pull_request.head.ref || github.ref_name }}
42+
fetch-depth: 0
2243

2344
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
2445
- name: Извлечение имени текущей ветки
2546
shell: bash
2647
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
2748
id: extract_branch
2849

29-
# Установка OneScript конкретной версии
3050
- name: Установка OneScript
31-
uses: otymko/setup-onescript@v1.0
32-
env:
33-
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
51+
uses: otymko/setup-onescript@v1.5
3452
with:
3553
version: ${{ matrix.oscript_version }}
3654

37-
# Установка зависимостей пакета
3855
- name: Установка зависимостей
3956
run: |
4057
opm install opm
4158
opm install --dev
42-
opm install 1testrunner
43-
opm install 1bdd
44-
opm install notify
45-
opm install coverage
59+
opm install gitsync # TODO: должно быть необязательно
60+
61+
- name: Подготовка окружения (Linux)
62+
if: startsWith(matrix.os, 'ubuntu')
63+
run: |
64+
sudo apt-get update
65+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y locales libwebkit2gtk-4.0-37
66+
sudo localedef -i ${{ matrix.locale }} -c -f UTF-8 -A /usr/share/locale/locale.alias ${{ matrix.locale }}.UTF-8
67+
68+
- name: Установка wine для Tool1CD (Linux)
69+
if: startsWith(matrix.os, 'ubuntu')
70+
run: |
71+
sudo dpkg --add-architecture i386
72+
sudo apt update
73+
sudo apt install wine -y
74+
75+
- name: Установка платформы 1С
76+
uses: 1CDevFlow/onec-setup-action@main
77+
with:
78+
type: onec # Тип устанавливаемого приложения
79+
onec_version: ${{ matrix.v8_version }}
80+
cache: true
81+
cache_distr: true
82+
env:
83+
ONEC_USERNAME: ${{ secrets.ONEC_USERNAME }}
84+
ONEC_PASSWORD: ${{ secrets.ONEC_PASSWORD }}
85+
86+
- name: Установка Java 17
87+
uses: actions/setup-java@v4
88+
with:
89+
distribution: 'temurin'
90+
java-version: '17'
91+
92+
- name: Установка EDT
93+
uses: 1CDevFlow/onec-setup-action@main
94+
with:
95+
type: edt
96+
edt_version: ${{ matrix.edt_version }}
97+
cache: true
98+
cache_distr: true
99+
env:
100+
ONEC_USERNAME: ${{ secrets.ONEC_USERNAME }}
101+
ONEC_PASSWORD: ${{ secrets.ONEC_PASSWORD }}
102+
103+
- name: Установка лицензии (Linux)
104+
if: startsWith(matrix.os, 'ubuntu')
105+
run: |
106+
# Создание каталога
107+
sudo mkdir -p /var/1C/licenses
108+
109+
# Запись лицензии в файл
110+
echo "${{ secrets.ONEC_LICENSE }}" | sudo tee /var/1C/licenses/licence.lic > /dev/null
111+
112+
# Назначение прав
113+
sudo chmod 777 -R /var/1C/licenses
114+
shell: bash
115+
env:
116+
ONEC_LICENSE: ${{ secrets.ONEC_LICENSE }}
117+
118+
- name: Установка gitsync локально
119+
run: opm run install-gitsync
46120

47-
# Запуск тестов и сбор покрытия кода
48121
- name: Покрытие кода
49-
run: oscript ./tasks/coverage.os true
122+
uses: coactions/setup-xvfb@v1
123+
env:
124+
EDT_VERSION: ${{ matrix.edt_version }}
125+
GITSYNC_V8VERSION: ${{ matrix.v8_version }}
126+
with:
127+
run: opm run coverage
50128

51129
- name: Извлечение версии пакета
52130
shell: bash
53131
run: echo "##[set-output name=version;]`cat packagedef | grep ".Версия(" | sed 's|[^"]*"||' | sed -r 's/".+//'`"
54132
id: extract_version
55133

56134
- name: Установка Sonar-scanner
57-
uses: warchant/setup-sonar-scanner@v1
135+
uses: warchant/setup-sonar-scanner@v8
58136

59-
# Анализ проекта в SonarQube (ветка)
60137
- name: Анализ в SonarQube (branch)
61-
if: github.event_name == 'push'
138+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
139+
env:
140+
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
62141
run: sonar-scanner
63-
-Dsonar.login=${{ secrets.SONARQUBE_TOKEN }}
64142
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
65143
-Dsonar.branch.name=${{ steps.extract_branch.outputs.branch }}
66144
-Dsonar.projectVersion=${{ steps.extract_version.outputs.version }}
67145

68-
# Анализ проекта в SonarQube (PR)
69146
# https://docs.sonarqube.org/latest/analysis/pull-request/
70147
- name: Анализ в SonarQube (pull-request)
71-
if: github.event_name == 'pull_request'
148+
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
149+
env:
150+
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
72151
run: sonar-scanner
73-
-Dsonar.login=${{ secrets.SONARQUBE_TOKEN }}
74152
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
75-
-Dsonar.branch.name=${{ steps.extract_branch.outputs.branch }}
76153
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
77154
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
78155
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }}

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
os: [ubuntu-latest]
18-
oscript_version: ['1.8.3']
18+
oscript_version: ['1.9.2']
1919
package_mask: ["gitsync-plugins-*.ospx"]
2020

2121
steps:

.github/workflows/testing.yml

Lines changed: 142 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,161 @@
33
# All rights reserved.
44

55
name: Тестирование
6-
# Любой пуш и pr в проекте
7-
on: [push, pull_request]
6+
7+
on:
8+
push:
9+
pull_request_target:
10+
workflow_dispatch:
11+
12+
permissions:
13+
checks: write
14+
pull-requests: write
815

916
jobs:
10-
build:
17+
test:
1118
runs-on: ${{ matrix.os }}
1219
strategy:
13-
fail-fast: false
1420
matrix:
15-
os: [ubuntu-latest]
16-
oscript_version: ['1.8.3']
17-
21+
oscript_version: ['1.9.2']
22+
v8_version: ['8.3.21.1624', '8.3.24.1691']
23+
edt_version: ['2023.3.6', '2024.2.5']
24+
os: [windows-latest, ubuntu-22.04]
25+
locale: ['ru_RU']
26+
fail-fast: false
1827
steps:
19-
# Загрузка проекта
28+
- name: Освобождение места
29+
if: startsWith(matrix.os, 'ubuntu')
30+
uses: easimon/maximize-build-space@master
31+
with:
32+
root-reserve-mb: 20480
33+
swap-size-mb: 1024
34+
remove-android: 'true'
35+
remove-haskell: 'true'
36+
remove-codeql: 'true'
37+
remove-docker-images: 'true'
38+
39+
- name: Установка локали
40+
if: matrix.os == startsWith(matrix.os, 'windows')
41+
run: |
42+
powershell -Command "Set-WinUILanguageOverride -Language ru-RU"
43+
powershell -Command "Set-WinUserLanguageList ru-RU -Force"
44+
powershell -Command "Set-Culture ru-RU"
45+
powershell -Command "Set-WinSystemLocale ru-RU"
46+
2047
- name: Актуализация
21-
uses: actions/checkout@v2
48+
uses: actions/checkout@v4.2.2
49+
with:
50+
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
51+
ref: ${{ github.event.pull_request.head.ref || github.ref_name }}
2252

23-
# Установка OneScript конкретной версии
2453
- name: Установка OneScript
25-
env:
26-
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
27-
uses: otymko/setup-onescript@v1.0
54+
uses: otymko/setup-onescript@v1.5
2855
with:
2956
version: ${{ matrix.oscript_version }}
3057

31-
# Установка зависимостей пакета
3258
- name: Установка зависимостей
3359
run: |
3460
opm install opm
3561
opm install --dev
36-
opm install 1testrunner
37-
opm install 1bdd
38-
opm install notify
39-
opm install coverage
40-
41-
# Задача тестирования, в результате ожидается успешное выполнение
42-
- name: Тестирование Unit
43-
run: oscript ./tasks/test.os true
44-
45-
# - name: Тестирование Integrated
46-
# run: |
47-
# docker run -e OSCRIPT_VERSION=${{ matrix.oscript_version }} -v $(pwd):/work_dir harmit/ci-image sh -c 'cd /work_dir; sh /work_dir/travis-ci.sh; exit'
48-
# grep 'Результат прогона тестов <Да>' /tmp/test.log
62+
opm install gitsync # TODO: должно быть необязательно
63+
64+
- name: Подготовка окружения (Linux)
65+
if: startsWith(matrix.os, 'ubuntu')
66+
run: |
67+
sudo apt-get update
68+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y locales libwebkit2gtk-4.0-37
69+
sudo localedef -i ${{ matrix.locale }} -c -f UTF-8 -A /usr/share/locale/locale.alias ${{ matrix.locale }}.UTF-8
70+
71+
- name: Установка libenchant1c2a для 8.3.21 (Linux)
72+
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.v8_version, '8.3.21')
73+
run: |
74+
sudo echo "deb http://cz.archive.ubuntu.com/ubuntu focal main universe" | sudo tee -a /etc/apt/sources.list
75+
sudo apt-get update
76+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libenchant1c2a
77+
78+
- name: Установка wine для Tool1CD (Linux)
79+
if: startsWith(matrix.os, 'ubuntu')
80+
run: |
81+
sudo dpkg --add-architecture i386
82+
sudo apt update
83+
sudo apt install wine -y
84+
85+
- name: Установка платформы 1С
86+
uses: 1CDevFlow/onec-setup-action@main
87+
with:
88+
type: onec # Тип устанавливаемого приложения
89+
onec_version: ${{ matrix.v8_version }}
90+
cache: true
91+
cache_distr: true
92+
env:
93+
ONEC_USERNAME: ${{ secrets.ONEC_USERNAME }}
94+
ONEC_PASSWORD: ${{ secrets.ONEC_PASSWORD }}
95+
96+
- name: Установка Java 11
97+
if: startsWith(matrix.edt_version, '2023')
98+
uses: actions/setup-java@v4
99+
with:
100+
distribution: 'temurin'
101+
java-version: '11'
102+
103+
- name: Установка Java 17
104+
if: startsWith(matrix.edt_version, '2024')
105+
uses: actions/setup-java@v4
106+
with:
107+
distribution: 'temurin'
108+
java-version: '17'
109+
110+
- name: Установка EDT
111+
uses: 1CDevFlow/onec-setup-action@main
112+
with:
113+
type: edt
114+
edt_version: ${{ matrix.edt_version }}
115+
cache: true
116+
cache_distr: true
117+
env:
118+
ONEC_USERNAME: ${{ secrets.ONEC_USERNAME }}
119+
ONEC_PASSWORD: ${{ secrets.ONEC_PASSWORD }}
120+
121+
- name: Установка лицензии (Linux)
122+
if: startsWith(matrix.os, 'ubuntu')
123+
run: |
124+
# Создание каталога
125+
sudo mkdir -p /var/1C/licenses
126+
127+
# Запись лицензии в файл
128+
echo "${{ secrets.ONEC_LICENSE }}" | sudo tee /var/1C/licenses/licence.lic > /dev/null
129+
130+
# Назначение прав
131+
sudo chmod 777 -R /var/1C/licenses
132+
shell: bash
133+
env:
134+
ONEC_LICENSE: ${{ secrets.ONEC_LICENSE }}
135+
136+
- name: Установка лицензии (Windows)
137+
if: startsWith(matrix.os, 'windows')
138+
run: |
139+
mkdir "C:\ProgramData\1C\licenses" -Force
140+
echo $Env:ONEC_LICENSE | Out-File -FilePath "C:\ProgramData\1C\licenses\licence.lic" -Encoding ascii
141+
shell: pwsh
142+
env:
143+
ONEC_LICENSE: ${{ secrets.ONEC_LICENSE }}
144+
145+
- name: Установка gitsync локально
146+
run: opm run install-gitsync
147+
148+
- name: Тестирование
149+
uses: coactions/setup-xvfb@v1
150+
env:
151+
EDT_VERSION: ${{ matrix.edt_version }}
152+
GITSYNC_V8VERSION: ${{ matrix.v8_version }}
153+
with:
154+
run: oscript ./tasks/test.os
155+
156+
- name: Публикация отчета
157+
if: success() || failure()
158+
uses: mikepenz/action-junit-report@v5
159+
with:
160+
report_paths: '**/build/reports/*.xml'
161+
fail_on_failure: true
162+
comment: true
163+
check_name: 'Результаты тестов. ОС: ${{ matrix.os }}. Версия 1С: ${{ matrix.v8_version }}. Версия OneScript: ${{ matrix.oscript_version }}. Версия EDT: ${{ matrix.edt_version }}'

0 commit comments

Comments
 (0)