From 34069774a327dd2d409bdaaad3647f629cc02a74 Mon Sep 17 00:00:00 2001 From: Andrey202929 Date: Sat, 20 Jun 2026 18:55:51 +0400 Subject: [PATCH 01/14] Add files via upload --- ci.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 ci.yml diff --git a/ci.yml b/ci.yml new file mode 100644 index 0000000..0f7244e --- /dev/null +++ b/ci.yml @@ -0,0 +1,5 @@ +name: CI + +on: push: branches: [ main, add-ci-for-smabot ] pull_request: branches: [ main ] + +jobs: lint-and-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 with: python-version: '3.12' - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt - name: Run tests run: pytest -q \ No newline at end of file From 8405631bfb09cad50bf0d70a848fe1cce5fbef52 Mon Sep 17 00:00:00 2001 From: Andrey202929 Date: Sat, 20 Jun 2026 20:36:07 +0400 Subject: [PATCH 02/14] Refactor CI configuration for improved structure --- ci.yml | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/ci.yml b/ci.yml index 0f7244e..6f582b4 100644 --- a/ci.yml +++ b/ci.yml @@ -1,5 +1,46 @@ name: CI -on: push: branches: [ main, add-ci-for-smabot ] pull_request: branches: [ main ] +on: + push: + branches: + - main + - add-ci-for-smabot + pull_request: + branches: + - main -jobs: lint-and-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 with: python-version: '3.12' - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt - name: Run tests run: pytest -q \ No newline at end of file +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + - name: Run tests + run: | + pytest -q + + - name: Telegram notification + if: always() + uses: appleboy/telegram-action@v0.4.0 + with: + to: ${{ secrets.TELEGRAM_CHAT_ID }} + token: ${{ secrets.TELEGRAM_BOT_TOKEN }} + message: | + Repo: ${{ github.repository }} + Workflow: ${{ github.workflow }} + Job: ${{ job.name }} + Status: ${{ job.status }} + Ref: ${{ github.ref }} + Run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} From caabfde9a71a4d3a381787c5459ec03f29eca6d9 Mon Sep 17 00:00:00 2001 From: Andrey202929 Date: Sat, 20 Jun 2026 20:43:05 +0400 Subject: [PATCH 03/14] Fix formatting issues in CI configuration From 8e69e3573cee073e3709d33d020db1f721d9d334 Mon Sep 17 00:00:00 2001 From: Andrey202929 Date: Sat, 20 Jun 2026 21:13:31 +0400 Subject: [PATCH 04/14] Trigger CI --- .github/workflows/ci.yml | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4302bc4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,46 @@ +name: CI + +on: + push: + branches: + - main + - add-ci-for-smabot + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + - name: Run tests + run: | + pytest -q + + - name: Telegram notification + if: always() + uses: appleboy/telegram-action@v0.4.0 + with: + to: ${{ secrets.TELEGRAM_CHAT_ID }} + token: ${{ secrets.TELEGRAM_BOT_TOKEN }} + message: | + Repo: ${{ github.repository }} + Workflow: ${{ github.workflow }} + Job: ${{ job.name }} + Status: ${{ job.status }} + Ref: ${{ github.ref }} + Run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} From 1a9bfcd995c59177f2088d2668a710f7e2bdfbbc Mon Sep 17 00:00:00 2001 From: Andrey202929 Date: Sat, 20 Jun 2026 21:19:14 +0400 Subject: [PATCH 05/14] Fix CI triggers (include master + dispatch) --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4302bc4..c28ae8a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,11 +3,14 @@ name: CI on: push: branches: + - master - main - add-ci-for-smabot pull_request: branches: + - master - main + workflow_dispatch: jobs: build: From 1f9867df64b2b89e0b0e8c350338cd587c626b1b Mon Sep 17 00:00:00 2001 From: Andrey202929 Date: Sat, 20 Jun 2026 21:26:24 +0400 Subject: [PATCH 06/14] Use appleboy/telegram-action@v1.0.1 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c28ae8a..78b9458 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: - name: Telegram notification if: always() - uses: appleboy/telegram-action@v0.4.0 + uses: appleboy/telegram-action@v1.0.1 with: to: ${{ secrets.TELEGRAM_CHAT_ID }} token: ${{ secrets.TELEGRAM_BOT_TOKEN }} From 44a152eaba67985d6623e3d917f6f201bc891888 Mon Sep 17 00:00:00 2001 From: Andrey202929 Date: Sat, 20 Jun 2026 21:29:27 +0400 Subject: [PATCH 07/14] Fix indentation for Telegram step --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 78b9458..6208af2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: - name: Telegram notification if: always() - uses: appleboy/telegram-action@v1.0.1 + uses: appleboy/telegram-action@v1.0.1 with: to: ${{ secrets.TELEGRAM_CHAT_ID }} token: ${{ secrets.TELEGRAM_BOT_TOKEN }} From 5bbd7566093876dc74d698871cf1c0ac79d65af1 Mon Sep 17 00:00:00 2001 From: Andrey202929 Date: Sat, 20 Jun 2026 21:32:19 +0400 Subject: [PATCH 08/14] Install pytest in CI and use python -m pytest --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6208af2..7a26209 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,11 +28,12 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip + python -m pip install pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Run tests run: | - pytest -q + python -m pytest -q - name: Telegram notification if: always() From 5581b7fbf1dffd2e6599ecdbf8b883d30fd31d3f Mon Sep 17 00:00:00 2001 From: Andrey202929 Date: Sat, 20 Jun 2026 21:37:47 +0400 Subject: [PATCH 09/14] Handle pytest exit code 5 (no tests) --- .github/workflows/ci.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a26209..5037335 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,15 @@ jobs: - name: Run tests run: | - python -m pytest -q + python -m pytest -q || rc=$? + if [ -n "${rc:-}" ]; then + if [ "$rc" -eq 5 ]; then + echo "No tests collected by pytest (exit code 5). Continuing without failing the job." + else + echo "pytest finished with exit code $rc. Failing the job." + exit $rc + fi + fi - name: Telegram notification if: always() From 35abb04d86eb6e375b445f4221aacfaf30c23edb Mon Sep 17 00:00:00 2001 From: Andrey202929 Date: Sat, 20 Jun 2026 21:41:46 +0400 Subject: [PATCH 10/14] Update actions to latest stable tags (checkout@v7.0.0, setup-python@v6.2.0) and keep pytest handling --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5037335..ca3d085 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,10 +18,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v7.0.0 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v6.2.0 with: python-version: '3.12' From e3248efc7e1dc306dc2c7e99741a8356f96febae Mon Sep 17 00:00:00 2001 From: Andrey202929 Date: Sat, 20 Jun 2026 21:46:14 +0400 Subject: [PATCH 11/14] Update workflow: upgrade actions, install pytest, handle no-tests, telegram notify From 5845b7cc6dfa885067a8773725a2a821c1c31800 Mon Sep 17 00:00:00 2001 From: Andrey202929 Date: Sat, 20 Jun 2026 21:55:18 +0400 Subject: [PATCH 12/14] Use curl for Telegram notification; install pytest; handle no-tests; upgrade actions --- .github/workflows/ci.yml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca3d085..39d35c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,16 +43,18 @@ jobs: fi fi - - name: Telegram notification + - name: Telegram notification (curl) if: always() - uses: appleboy/telegram-action@v1.0.1 - with: - to: ${{ secrets.TELEGRAM_CHAT_ID }} - token: ${{ secrets.TELEGRAM_BOT_TOKEN }} - message: | - Repo: ${{ github.repository }} - Workflow: ${{ github.workflow }} - Job: ${{ job.name }} - Status: ${{ job.status }} - Ref: ${{ github.ref }} - Run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + run: | + if [ -z "${{ secrets.TELEGRAM_BOT_TOKEN }}" ] || [ -z "${{ secrets.TELEGRAM_CHAT_ID }}" ]; then + echo "Missing TELEGRAM_BOT_TOKEN or TELEGRAM_CHAT_ID secret; skipping Telegram notification." + else + resp=$(curl -s -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" -d chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" -d text="Repo: ${{ github.repository }} | Workflow: ${{ github.workflow }} | Job: ${{ job.name }} | Status: ${{ job.status }} | Run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" ) + echo "Telegram response: $resp" + if echo "$resp" | grep -q '"ok":true'; then + echo "Telegram message sent." + else + echo "Telegram API returned error." + exit 1 + fi + fi From 4648648422e8c5930ab827a6464b32507843e8ca Mon Sep 17 00:00:00 2001 From: Andrey202929 Date: Sat, 20 Jun 2026 22:13:02 +0400 Subject: [PATCH 13/14] Don't fail job on Telegram errors; keep pytest behavior and install pytest --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39d35c9..10b787b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,6 +45,7 @@ jobs: - name: Telegram notification (curl) if: always() + continue-on-error: true run: | if [ -z "${{ secrets.TELEGRAM_BOT_TOKEN }}" ] || [ -z "${{ secrets.TELEGRAM_CHAT_ID }}" ]; then echo "Missing TELEGRAM_BOT_TOKEN or TELEGRAM_CHAT_ID secret; skipping Telegram notification." @@ -54,7 +55,6 @@ jobs: if echo "$resp" | grep -q '"ok":true'; then echo "Telegram message sent." else - echo "Telegram API returned error." - exit 1 + echo "Telegram API returned error: $resp" fi fi From 8c97c4cee59d8a99b8834c9dcf244826ee9d77e5 Mon Sep 17 00:00:00 2001 From: Andrey202929 Date: Sat, 20 Jun 2026 22:39:03 +0400 Subject: [PATCH 14/14] Replace appleboy telegram action with curl notification and don't fail job on errors --- .github/workflows/ci.yml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10b787b..23ad681 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,14 +47,21 @@ jobs: if: always() continue-on-error: true run: | + echo "Attempting to send Telegram notification..." if [ -z "${{ secrets.TELEGRAM_BOT_TOKEN }}" ] || [ -z "${{ secrets.TELEGRAM_CHAT_ID }}" ]; then echo "Missing TELEGRAM_BOT_TOKEN or TELEGRAM_CHAT_ID secret; skipping Telegram notification." + exit 0 + fi + + # Send message and print raw response for debugging + resp=$(curl -s -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \ + -d chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \ + -d text="Repo: ${{ github.repository }} | Workflow: ${{ github.workflow }} | Job: ${{ job.name }} | Status: ${{ job.status }} | Run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}") + + echo "Telegram response: $resp" + if echo "$resp" | grep -q '"ok":true'; then + echo "Telegram message sent." else - resp=$(curl -s -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" -d chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" -d text="Repo: ${{ github.repository }} | Workflow: ${{ github.workflow }} | Job: ${{ job.name }} | Status: ${{ job.status }} | Run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" ) - echo "Telegram response: $resp" - if echo "$resp" | grep -q '"ok":true'; then - echo "Telegram message sent." - else - echo "Telegram API returned error: $resp" - fi + echo "Telegram API returned error." + echo "$resp" fi