mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2024-12-16 11:38:11 +02:00
96 lines
2.6 KiB
YAML
96 lines
2.6 KiB
YAML
|
|
name: Тестирование OINT CLI
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
Decode:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Расшифровать тестовые данные
|
|
run: gpg --quiet --batch --yes --decrypt --passphrase="$ENC_JSON" --output ./data.json ./data.json.gpg
|
|
env:
|
|
ENC_JSON: ${{ secrets.ENC_JSON }}
|
|
|
|
- name: Кэшировать данные
|
|
uses: actions/cache/save@v3
|
|
with:
|
|
path: ./data.json
|
|
key: test-data
|
|
|
|
Build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: otymko/setup-onescript@v1.4
|
|
with:
|
|
version: 1.9.0
|
|
|
|
- name: Установить cmdline и asserts
|
|
run: |
|
|
opm install cmdline
|
|
opm install asserts
|
|
|
|
- name: Собрать и установить OInt
|
|
run: |
|
|
cd ./OInt
|
|
opm build
|
|
opm install *.ospx
|
|
|
|
- name: Собрать бинарник
|
|
run: |
|
|
cd ./cli
|
|
oscript -make app.os oint_bin
|
|
|
|
- name: Записать артефакт
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: oint
|
|
path: ./cli/oint_bin
|
|
|
|
Testing-Telegram:
|
|
runs-on: ubuntu-latest
|
|
needs: [Decode, Build]
|
|
steps:
|
|
|
|
- name: Получить тестовые данные из кэша
|
|
uses: actions/cache/restore@v3
|
|
with:
|
|
path: ./data.json
|
|
key: test-data
|
|
|
|
- name: Скачать артефакт с исполняемым файлом
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: oint
|
|
|
|
- name: JSON to variables
|
|
uses: rgarcia-phi/json-to-variables@v1.1.0
|
|
with:
|
|
filename: 'data.json'
|
|
masked: true
|
|
|
|
- name: chmod для OInt
|
|
run: chmod +x ./oint_bin
|
|
- name: Выполнить Телеграм_ПолучитьИнформациюБота
|
|
if: ${{ cancelled() }} == false
|
|
run: ./oint_bin telegram ПолучитьИнформациюБота --token ${{ env.json_Telegram_Token }}
|
|
|
|
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" \
|
|
"https://api.github.com/repos/Bayselonarrend/OpenIntegrations/actions/caches?key=test-data"
|
|
|