1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2024-12-16 11:38:11 +02:00
OpenIntegrations/.github/workflows/cli_test.yml

96 lines
2.6 KiB
YAML
Raw Normal View History

2024-03-20 15:36:22 +02:00
name: Тестирование OINT CLI
on:
workflow_dispatch:
jobs:
Decode:
runs-on: ubuntu-latest
steps:
2024-03-20 21:04:02 +02:00
- uses: actions/checkout@v4
2024-03-20 15:36:22 +02:00
- name: Расшифровать тестовые данные
run: gpg --quiet --batch --yes --decrypt --passphrase="$ENC_JSON" --output ./data.json ./data.json.gpg
env:
ENC_JSON: ${{ secrets.ENC_JSON }}
2024-03-20 20:09:56 +02:00
2024-03-20 20:57:29 +02:00
- name: Кэшировать данные
uses: actions/cache/save@v3
2024-03-20 15:36:22 +02:00
with:
2024-03-20 20:57:29 +02:00
path: ./data.json
2024-03-20 21:00:39 +02:00
key: test-data
2024-03-20 15:36:22 +02:00
2024-03-20 20:09:56 +02:00
Build:
runs-on: ubuntu-latest
steps:
2024-03-20 21:04:02 +02:00
- uses: actions/checkout@v4
2024-03-20 20:09:56 +02:00
- uses: otymko/setup-onescript@v1.4
with:
version: 1.9.0
2024-03-20 20:15:04 +02:00
- name: Установить cmdline и asserts
run: |
opm install cmdline
opm install asserts
- name: Собрать и установить OInt
run: |
cd ./OInt
opm build
opm install oint-1.5.0.ospx
2024-03-20 20:09:56 +02:00
- name: Собрать бинарник
run: |
cd ./cli
2024-03-20 20:18:28 +02:00
oscript -make app.os oint_bin
2024-03-20 20:09:56 +02:00
- name: Записать артефакт
uses: actions/upload-artifact@v4
with:
name: oint
2024-03-20 20:20:21 +02:00
path: ./cli/oint_bin
2024-03-20 20:09:56 +02:00
2024-03-20 15:36:22 +02:00
Testing-Telegram:
runs-on: ubuntu-latest
2024-03-20 20:09:56 +02:00
needs: [Decode, Build]
2024-03-20 15:36:22 +02:00
steps:
2024-03-20 21:00:39 +02:00
- name: Получить тестовые данные из кэша
2024-03-20 20:57:29 +02:00
uses: actions/cache/restore@v3
2024-03-20 15:36:22 +02:00
with:
2024-03-20 20:57:29 +02:00
path: ./data.json
2024-03-20 21:00:39 +02:00
key: test-data
2024-03-20 15:36:22 +02:00
2024-03-20 20:09:56 +02:00
- name: Скачать артефакт с исполняемым файлом
uses: actions/download-artifact@v4
with:
name: oint
2024-03-20 15:36:22 +02:00
- name: JSON to variables
uses: rgarcia-phi/json-to-variables@v1.1.0
with:
filename: 'data.json'
masked: true
2024-03-20 20:33:10 +02:00
- name: chmod для OInt
run: chmod +x ./oint_bin
2024-03-20 20:09:56 +02:00
- name: Выполнить Телеграм_ПолучитьИнформациюБота
if: ${{ cancelled() }} == false
2024-03-20 20:22:45 +02:00
run: ./oint_bin telegram ПолучитьИнформациюБота --token ${{ env.json_Telegram_Token }}
2024-03-20 21:12:42 +02:00
Clear-Cache:
runs-on: ubuntu-latest
needs: [Testing-Telegram]
steps:
- name: Очистка кэша
run: |
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
2024-03-20 21:15:52 +02:00
"https://api.github.com/repos/Bayselonarrend/OpenIntegrations/actions/caches?key=test-data"