Skip to content

Commit 7f1802e

Browse files
committed
feat: add ConnectionTypeEnum and ConnectionConfigDTO to support DSN-based resolution
- Introduced ConnectionTypeEnum for normalized adapter types - Added ConnectionConfigDTO to unify connection configuration structure - Updated internal documentation and prepared for DSN routing in data-adapters - Part of Phase 10 preparation (maatify/data-adapters)
1 parent 0c4b173 commit 7f1802e

1 file changed

Lines changed: 73 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ jobs:
1414
name: 🔧 Build & Test (PHP 8.4)
1515
runs-on: ubuntu-latest
1616

17+
env:
18+
GH_START_ISO: ${{ github.event.head_commit.timestamp }}
19+
1720
strategy:
1821
fail-fast: false
1922
matrix:
@@ -71,6 +74,76 @@ jobs:
7174
name: phpunit-coverage-report
7275
path: .phpunit.cache/
7376

77+
- name: 📲 Notify Telegram
78+
if: always()
79+
env:
80+
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_CI_BOT_TOKEN }}
81+
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CI_CHAT_ID }}
82+
run: |
83+
84+
START_TS=$(date -u -d "$GH_START_ISO" +%s)
85+
END_TS=$(date +%s)
86+
87+
START_TIME=$(date -u -d "@$START_TS" +"%H:%M:%S UTC")
88+
END_TIME=$(date -u +"%H:%M:%S UTC")
89+
DURATION=$((END_TS - START_TS))
90+
91+
if [ "$DURATION" -lt 60 ]; then
92+
DURATION_STR="${DURATION}s"
93+
else
94+
DURATION_STR="$(($DURATION / 60))m $(($DURATION % 60))s"
95+
fi
96+
97+
STATUS="✅ Tests passed successfully!"
98+
COLOR="🟢"
99+
HEADER="Maatify CI Report"
100+
101+
if grep -q "FAILURES!" phpunit.log || [ "${{ job.status }}" != "success" ]; then
102+
STATUS="❌ Some tests failed. Please review the log."
103+
COLOR="🔴"
104+
HEADER="Maatify CI Alert"
105+
fi
106+
107+
PROJECT="maatify/common"
108+
BRANCH="$GITHUB_REF_NAME"
109+
ACTOR="$GITHUB_ACTOR"
110+
URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
111+
112+
MESSAGE="📢 <b>${HEADER}</b>
113+
114+
${COLOR} ${STATUS}
115+
116+
📦 <b>Project:</b> ${PROJECT}
117+
🧱 <b>Branch:</b> ${BRANCH}
118+
👷‍♂️ <b>Committer:</b> ${ACTOR}
119+
120+
⏱ <b>Start:</b> ${START_TIME}
121+
🕒 <b>End:</b> ${END_TIME}
122+
📈 <b>Duration:</b> ${DURATION_STR}
123+
124+
🔗 <a href='${URL}'>View Run Log</a>"
125+
126+
PAYLOAD=$(jq -n \
127+
--arg chat_id "$TELEGRAM_CHAT_ID" \
128+
--arg text "$MESSAGE" \
129+
--arg parse_mode "HTML" \
130+
'{chat_id: $chat_id, text: $text, parse_mode: $parse_mode}')
131+
132+
RESPONSE=$(curl -s -o /tmp/tg_resp.json -w "%{http_code}" \
133+
-X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
134+
-H "Content-Type: application/json" \
135+
-d "$PAYLOAD")
136+
137+
echo "Raw Telegram Response (HTTP $RESPONSE):"
138+
cat /tmp/tg_resp.json
139+
140+
if [ "$RESPONSE" -ne 200 ]; then
141+
echo "⚠️ Telegram notification failed (HTTP $RESPONSE)" >> $GITHUB_STEP_SUMMARY
142+
cat /tmp/tg_resp.json >> $GITHUB_STEP_SUMMARY
143+
else
144+
echo "✅ Telegram notification sent successfully." >> $GITHUB_STEP_SUMMARY
145+
fi
146+
74147
- name: 📊 Summary
75148
if: always()
76149
run: |

0 commit comments

Comments
 (0)