2024-05-19 12:20:10 +02:00
|
|
|
|
|
|
|
name: OINT | Тестирование Dropbox
|
|
|
|
|
|
|
|
# Controls when the workflow will run
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
Decode:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: ${{ always() }}
|
|
|
|
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:
|
|
|
|
key: test-data
|
|
|
|
path: ./data.json
|
|
|
|
|
|
|
|
Build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: otymko/setup-onescript@v1.4
|
|
|
|
with:
|
|
|
|
version: 1.9.0
|
|
|
|
|
|
|
|
- name: Установить asserts и 1testrunner
|
|
|
|
run: |
|
|
|
|
opm install asserts
|
|
|
|
opm install 1testrunner
|
|
|
|
|
|
|
|
- name: Установить OInt
|
|
|
|
run: |
|
2024-05-31 23:10:37 +02:00
|
|
|
cd ./src/ru/OInt
|
2024-05-19 12:20:10 +02:00
|
|
|
opm build
|
|
|
|
opm install *.ospx
|
|
|
|
|
|
|
|
- name: Записать артефакт
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: oint
|
2024-05-31 23:10:37 +02:00
|
|
|
path: ./src/ru/OInt/*.ospx
|
2024-05-19 12:20:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
Testing-Dropbox:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [Decode, Build]
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: otymko/setup-onescript@v1.4
|
|
|
|
with:
|
|
|
|
version: 1.9.0
|
|
|
|
|
|
|
|
- name: Получить тестовые данные из кэша
|
|
|
|
uses: actions/cache/restore@v3
|
|
|
|
with:
|
|
|
|
key: test-data
|
|
|
|
path: ./data.json
|
|
|
|
|
|
|
|
- name: Установить asserts и 1testrunner
|
|
|
|
run: |
|
|
|
|
opm install asserts
|
|
|
|
opm install 1testrunner
|
|
|
|
|
|
|
|
- name: Установить OInt
|
|
|
|
run: |
|
2024-05-31 23:10:37 +02:00
|
|
|
cd ./src/ru/OInt
|
2024-05-19 12:20:10 +02:00
|
|
|
opm build
|
|
|
|
opm install *.ospx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Получить/Обновить токен
|
|
|
|
if: ${{ cancelled() }} == false
|
2024-05-31 23:10:37 +02:00
|
|
|
run: oscript /home/runner/.local/share/ovm/current/lib/1testrunner/src/main.os -run ./src/ru/OInt/tests/Modules/internal/OPI_Тесты.os "ДропБокс_ПолучитьОбновитьТокен"
|
2024-05-19 12:20:10 +02:00
|
|
|
|
|
|
|
- name: Загрузить файл
|
|
|
|
if: ${{ cancelled() }} == false
|
2024-05-31 23:10:37 +02:00
|
|
|
run: oscript /home/runner/.local/share/ovm/current/lib/1testrunner/src/main.os -run ./src/ru/OInt/tests/Modules/internal/OPI_Тесты.os "ДропБокс_ЗагрузитьФайл"
|
2024-05-19 12:20:10 +02:00
|
|
|
|
2024-05-25 13:27:51 +02:00
|
|
|
- name: Загрузить файл по URL
|
|
|
|
if: ${{ cancelled() }} == false
|
2024-05-31 23:10:37 +02:00
|
|
|
run: oscript /home/runner/.local/share/ovm/current/lib/1testrunner/src/main.os -run ./src/ru/OInt/tests/Modules/internal/OPI_Тесты.os "ДропБокс_ЗагрузитьФайлПоURL"
|
2024-05-25 13:27:51 +02:00
|
|
|
|
2024-05-24 22:25:42 +02:00
|
|
|
- name: Создать каталог
|
|
|
|
if: ${{ cancelled() }} == false
|
2024-05-31 23:10:37 +02:00
|
|
|
run: oscript /home/runner/.local/share/ovm/current/lib/1testrunner/src/main.os -run ./src/ru/OInt/tests/Modules/internal/OPI_Тесты.os "ДропБокс_СоздатьКаталог"
|
2024-05-24 22:25:42 +02:00
|
|
|
|
2024-05-25 15:41:05 +02:00
|
|
|
- name: Создать/Удалить тег
|
|
|
|
if: ${{ cancelled() }} == false
|
2024-05-31 23:10:37 +02:00
|
|
|
run: oscript /home/runner/.local/share/ovm/current/lib/1testrunner/src/main.os -run ./src/ru/OInt/tests/Modules/internal/OPI_Тесты.os "ДропБокс_СоздатьУдалитьТег"
|
2024-05-25 15:41:05 +02:00
|
|
|
|
2024-05-26 09:37:42 +02:00
|
|
|
- name: Получить данные аккаунта
|
|
|
|
if: ${{ cancelled() }} == false
|
2024-05-31 23:10:37 +02:00
|
|
|
run: oscript /home/runner/.local/share/ovm/current/lib/1testrunner/src/main.os -run ./src/ru/OInt/tests/Modules/internal/OPI_Тесты.os "ДропБокс_ПолучитьАккаунт"
|
2024-05-26 09:37:42 +02:00
|
|
|
|
2024-05-27 18:58:06 +02:00
|
|
|
- name: Работа с доступами
|
|
|
|
if: ${{ cancelled() }} == false
|
2024-05-31 23:10:37 +02:00
|
|
|
run: oscript /home/runner/.local/share/ovm/current/lib/1testrunner/src/main.os -run ./src/ru/OInt/tests/Modules/internal/OPI_Тесты.os "ДропБокс_РаботаСДоступами"
|
2024-05-27 18:58:06 +02:00
|
|
|
|
2024-06-09 00:07:55 +02:00
|
|
|
- name: Получить список файлов папки
|
|
|
|
if: ${{ cancelled() }} == false
|
|
|
|
run: oscript /home/runner/.local/share/ovm/current/lib/1testrunner/src/main.os -run ./src/ru/OInt/tests/Modules/internal/OPI_Тесты.os "ДропБокс_ПолучитьСписокФайловПапки"
|
|
|
|
|
2024-05-28 15:24:04 +02:00
|
|
|
- name: Записать логи
|
|
|
|
if: ${{ cancelled() }} == false
|
|
|
|
uses: actions/cache/save@v3
|
|
|
|
with:
|
|
|
|
key: logs-Dropbox
|
2024-06-11 16:19:52 +02:00
|
|
|
path: ./docs/ru/results/Dropbox
|
2024-05-28 15:24:04 +02:00
|
|
|
|
2024-05-19 12:20:10 +02:00
|
|
|
|
|
|
|
- name: Записать измененные данные
|
|
|
|
if: ${{ cancelled() }} == false
|
|
|
|
uses: actions/cache/save@v3
|
|
|
|
with:
|
|
|
|
key: test-data_new
|
|
|
|
path: ./data.json
|
|
|
|
|
|
|
|
Encode:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [Testing-Dropbox]
|
|
|
|
if: ${{ always() }}
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Обновить данные в репозитории
|
|
|
|
run: git pull https://github.com/Bayselonarrend/OpenIntegrations
|
|
|
|
|
|
|
|
- name: Получить тестовые данные из кэша
|
|
|
|
uses: actions/cache/restore@v3
|
|
|
|
with:
|
|
|
|
key: test-data_new
|
|
|
|
path: ./data.json
|
|
|
|
|
|
|
|
- name: Зашифровать данные обратно
|
|
|
|
continue-on-error: false
|
|
|
|
|
|
|
|
run: |
|
|
|
|
rm -f ./data.json.gpg
|
|
|
|
gpg --batch --symmetric --cipher-algo AES256 --passphrase="$ENC_JSON" data.json
|
|
|
|
rm -f ./data.json
|
|
|
|
env:
|
|
|
|
ENC_JSON: ${{ secrets.ENC_JSON }}
|
|
|
|
|
2024-05-28 15:24:04 +02:00
|
|
|
- name: Получить логи Dropbox
|
|
|
|
uses: actions/cache/restore@v3
|
|
|
|
with:
|
|
|
|
key: logs-Dropbox
|
2024-06-11 16:19:52 +02:00
|
|
|
path: ./docs/ru/results/Dropbox
|
2024-05-28 15:24:04 +02:00
|
|
|
|
|
|
|
|
2024-05-28 15:48:37 +02:00
|
|
|
- name: Очистка логов Dropbox
|
|
|
|
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=logs-Dropbox"
|
|
|
|
|
|
|
|
|
2024-05-19 12:20:10 +02:00
|
|
|
- name: Записать данные
|
|
|
|
uses: stefanzweifel/git-auto-commit-action@v5
|
|
|
|
with:
|
|
|
|
commit_user_name: Vitaly the Alpaca (bot)
|
|
|
|
commit_user_email: vitaly.the.alpaca@gmail.com
|
|
|
|
commit_author: Vitaly the Alpaca <vitaly.the.alpaca@gmail.com>
|
|
|
|
commit_message: Обновление зашифрованных данных по результатам тестов (workflow)
|
|
|
|
|
|
|
|
|
|
|
|
Clear-Cache:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [Testing-Dropbox, Encode]
|
|
|
|
if: ${{ always() }}
|
|
|
|
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"
|
|
|
|
|
|
|
|
- name: Очистка кэша Google
|
|
|
|
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_google"
|
|
|
|
|
|
|
|
- name: Очистка кэша Twitter
|
|
|
|
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_new"
|