From 1b96be7c56ec34d7ea65af3d5ec0bd6b31d76fc8 Mon Sep 17 00:00:00 2001 From: mrognor Date: Sun, 5 Jan 2025 21:23:11 +0300 Subject: [PATCH] Add ci report sending to telegram --- .../TelegramReport/SendCiReportToTelegram.py | 5 +++ .../TelegramReport/SendCiReportToTelegram.sh | 11 ++++++ .github/workflows/static.yml | 39 ++++++++++--------- 3 files changed, 37 insertions(+), 18 deletions(-) create mode 100644 .github/TelegramReport/SendCiReportToTelegram.py create mode 100755 .github/TelegramReport/SendCiReportToTelegram.sh diff --git a/.github/TelegramReport/SendCiReportToTelegram.py b/.github/TelegramReport/SendCiReportToTelegram.py new file mode 100644 index 0000000..763a7e0 --- /dev/null +++ b/.github/TelegramReport/SendCiReportToTelegram.py @@ -0,0 +1,5 @@ +import sys +import telebot + +botTimeWeb = telebot.TeleBot(sys.argv[1]) +botTimeWeb.send_message(sys.argv[2], "CI jobs finished!", parse_mode='html', reply_markup=telebot.types.InlineKeyboardMarkup()) \ No newline at end of file diff --git a/.github/TelegramReport/SendCiReportToTelegram.sh b/.github/TelegramReport/SendCiReportToTelegram.sh new file mode 100755 index 0000000..bed3dd6 --- /dev/null +++ b/.github/TelegramReport/SendCiReportToTelegram.sh @@ -0,0 +1,11 @@ +# Navigate to root dir +cd $(dirname "$0") +path=$(pwd) + +# Create venv +python -m venv env +source $path/env/bin/activate +pip install pyTelegramBotAPI + +# Call python scripts +python SendCiReportToTelegram.py $1 $2 \ No newline at end of file diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index c033420..7783465 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -35,31 +35,34 @@ jobs: uses: actions/configure-pages@v5 - name: Install packages - run: sudo apt-get update && sudo apt-get upgrade && sudo DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install doxygen graphviz lcov cmake pipx clang clang-tidy cppcheck + run: sudo apt-get update && sudo apt-get upgrade && sudo DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install doxygen graphviz lcov cmake pipx clang clang-tidy cppcheck python3 - - name: Install CodeChecker - run: sudo pipx install CodeChecker --force + # - name: Install CodeChecker + # run: sudo pipx install CodeChecker --force - - name: Create documentation - run: ./Docs/Gendoc.sh + # - name: Create documentation + # run: ./Docs/Gendoc.sh - - name: Run tests - run: ./Scripts/RunTests.sh + # - name: Run tests + # run: ./Scripts/RunTests.sh - - name: Test coverage - run: ./Scripts/TestCoverage.sh + # - name: Test coverage + # run: ./Scripts/TestCoverage.sh - - name: Move coverage artifact - run: mv ./Coverage ./Docs/Generated/html + # - name: Move coverage artifact + # run: mv ./Coverage ./Docs/Generated/html - - name: Run sast - run: ./Scripts/RunSast.sh + # - name: Run sast + # run: ./Scripts/RunSast.sh - - name: Move sast artifacts - run: | - mv ./Sast/html_clang_tidy ./Docs/Generated/html - mv ./Sast/html_clangsa ./Docs/Generated/html - mv ./Sast/html_cppcheck ./Docs/Generated/html + # - name: Move sast artifacts + # run: | + # mv ./Sast/html_clang_tidy ./Docs/Generated/html + # mv ./Sast/html_clangsa ./Docs/Generated/html + # mv ./Sast/html_cppcheck ./Docs/Generated/html + + - name: Send report to telegram + run: ./.github/TelegramReport/SendCiReportToTelegram.sh ${{ secrets.BotId }} ${{ secrets.ChatId }} - name: Upload artifact uses: actions/upload-pages-artifact@v3