-
Notifications
You must be signed in to change notification settings - Fork 41
165 lines (144 loc) · 5.8 KB
/
testing.yml
File metadata and controls
165 lines (144 loc) · 5.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# MIT License
# Copyright (C) 2020 Tymko Oleg <olegtymko@yandex.ru> and contributors
# All rights reserved.
name: Тестирование
on:
push:
pull_request_target:
workflow_dispatch:
permissions:
checks: write
pull-requests: write
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
oscript_version: ['1.9.2', '2.0.0']
v8_version: ['8.3.21.1624', '8.3.24.1691']
edt_version: ['2023.3.6', '2024.2.5']
os: [windows-latest, ubuntu-22.04]
locale: ['ru_RU']
fail-fast: false
steps:
- name: Освобождение места
if: startsWith(matrix.os, 'ubuntu')
run: |
df -h
echo "-- Android"
sudo rm -rf /usr/local/lib/android
echo "-- Haskell"
sudo rm -rf /opt/ghc
echo "-- CodeQL"
sudo rm -rf /opt/hostedtoolcache/CodeQL
echo "-- docker images"
sudo docker image prune --all --force
df -h
- name: Установка локали
if: matrix.os == startsWith(matrix.os, 'windows')
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: Актуализация
uses: actions/checkout@v4.2.2
with:
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
ref: ${{ github.event.pull_request.head.ref || github.ref_name }}
- name: Установка OneScript
uses: otymko/setup-onescript@v1.5
with:
version: ${{ matrix.oscript_version }}
- name: Установка зависимостей
run: |
opm install opm
opm install --dev
opm install gitsync # TODO: должно быть необязательно
- name: Подготовка окружения (Linux)
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y locales libwebkit2gtk-4.0-37
sudo localedef -i ${{ matrix.locale }} -c -f UTF-8 -A /usr/share/locale/locale.alias ${{ matrix.locale }}.UTF-8
- name: Установка libenchant1c2a для 8.3.21 (Linux)
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.v8_version, '8.3.21')
run: |
sudo echo "deb http://cz.archive.ubuntu.com/ubuntu focal main universe" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libenchant1c2a
- name: Установка wine для Tool1CD (Linux)
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install wine -y
- name: Установка платформы 1С
uses: 1CDevFlow/onec-setup-action@main
with:
type: onec # Тип устанавливаемого приложения
onec_version: ${{ matrix.v8_version }}
cache: true
cache_distr: true
env:
ONEC_USERNAME: ${{ secrets.ONEC_USERNAME }}
ONEC_PASSWORD: ${{ secrets.ONEC_PASSWORD }}
- name: Установка Java 11
if: startsWith(matrix.edt_version, '2023')
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
- name: Установка Java 17
if: startsWith(matrix.edt_version, '2024')
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Установка EDT
uses: 1CDevFlow/onec-setup-action@main
with:
type: edt
edt_version: ${{ matrix.edt_version }}
cache: true
cache_distr: true
env:
ONEC_USERNAME: ${{ secrets.ONEC_USERNAME }}
ONEC_PASSWORD: ${{ secrets.ONEC_PASSWORD }}
- name: Установка лицензии (Linux)
if: startsWith(matrix.os, 'ubuntu')
run: |
# Создание каталога
sudo mkdir -p /var/1C/licenses
# Запись лицензии в файл
echo "${{ secrets.ONEC_LICENSE }}" | sudo tee /var/1C/licenses/licence.lic > /dev/null
# Назначение прав
sudo chmod 777 -R /var/1C/licenses
shell: bash
env:
ONEC_LICENSE: ${{ secrets.ONEC_LICENSE }}
- name: Установка лицензии (Windows)
if: startsWith(matrix.os, 'windows')
run: |
mkdir "C:\ProgramData\1C\licenses" -Force
echo $Env:ONEC_LICENSE | Out-File -FilePath "C:\ProgramData\1C\licenses\licence.lic" -Encoding ascii
shell: pwsh
env:
ONEC_LICENSE: ${{ secrets.ONEC_LICENSE }}
- name: Установка gitsync локально
run: opm run install-gitsync
- name: Тестирование
uses: coactions/setup-xvfb@v1
env:
EDT_VERSION: ${{ matrix.edt_version }}
GITSYNC_V8VERSION: ${{ matrix.v8_version }}
with:
run: oscript ./tasks/test.os
- name: Публикация отчета
if: success() || failure()
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: ${{ matrix.oscript_version }}. Версия EDT: ${{ matrix.edt_version }}'