Skip to content

logging Enhancements #8

logging Enhancements

logging Enhancements #8

Workflow file for this run

# Test Run the bot to start up with no exceptions.
name: Telegram Run Bot Test
on:
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./
strategy:
matrix:
python-version: [3.11]
env:
BOT_USERNAME: ${{secrets.BOT_USERNAME}}
BOT_TOKEN: ${{secrets.BOT_TOKEN}}
FIRST_RUN_FS: ${{secrets.FIRST_RUN_FS}}
JOB_INTERVAL_FS: ${{secrets.JOB_INTERVAL_FS}}
FT_LIMIT: ${{secrets.FT_LIMIT}}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{matrix.python-version}}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r ./requirements.txt
- name: Run Bot Test
run: |
python ./bot.py > output.log 2>&1 &
bot_pid=$!
sleep 10
kill $bot_pid
if grep -q "telegram.ext.Application - INFO - Application started" output.log; then
echo "Bot started successfully with no errors."
exit 0
elif grep -q "WARNING\|ERROR\|EXCEPTION" output.log; then
echo "Errors or warnings found in Bot logs."
exit 1
else
echo "No relevant messages found in logs."
exit 1
fi