Skip to content

Commit

Permalink
Add ci report sending to telegram
Browse files Browse the repository at this point in the history
  • Loading branch information
mrognor committed Jan 5, 2025
1 parent 474eda9 commit 51397b5
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 18 deletions.
39 changes: 21 additions & 18 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 python

- 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: ./Scripts/SendCiReportToTelegram.sh ${{ secrets.BotId }} ${{ secrets.ChatId }}

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
Expand Down
5 changes: 5 additions & 0 deletions Resources/Python/SendCiReportToTelegram.py
Original file line number Diff line number Diff line change
@@ -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())
19 changes: 19 additions & 0 deletions Scripts/SendCiReportToTelegram.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Navigate to root dir
cd $(dirname "$0")
cd ..
path=$(pwd)

# tmp
rm -rf Build/Telegram

# Create venv
mkdir -p Build/Telegram
cd Build/Telegram
python -m venv env
source $path/Build/Telegram/env/bin/activate
pip install pyTelegramBotAPI
cd ../..

# Call python scripts
cp Resources/Python/SendCiReportToTelegram.py Build/Telegram
python Build/Telegram/SendCiReportToTelegram.py $1 $2

0 comments on commit 51397b5

Please sign in to comment.