Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 34 additions & 8 deletions .github/workflows/testsPython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ on:

env:
python-version: "3.13"

# define run environment
jobs:
# Job #1: Run Python unit tests
#
Expand Down Expand Up @@ -70,10 +70,36 @@ jobs:
needs: python-unit-tests
runs-on: ubuntu-latest
steps:
- name: Notify on test results
run: |
if [ "${{ needs.python-unit-tests.result }}" == "success" ]; then
echo "success notifications go here"
else
echo "failure notifications go here"
fi
# - name: Notify on test results
# run: |
# if [ "${{ needs.python-unit-tests.result }}" == "success" ]; then
# echo "success notifications go here"
# else
# echo "failure notifications go here"
# fi
- name: Notify Discord on failure
if: always()
run: |
curl -H "Content-Type: application/json" \
-X POST \
-d '{
"embeds": [{
"title": "❌ CI Build Failed",
"color": 15548997,
"fields": [
{"name": "Repository", "value": "'"$REPO"'", "inline": true},
{"name": "Branch", "value": "'"$BRANCH"'", "inline": true},
{"name": "Commit", "value": "'"$SHA"'", "inline": false},
{"name": "Triggered by", "value": "'"$ACTOR"'","inline": true},
{"name": "Logs", "value": "[View run]('"$LOGS_URL"')", "inline": false}
]
}]
}' \
"$DISCORD_WEBHOOK_URL"
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
REPO: ${{ github.repository }}
BRANCH: ${{ github.ref_name }}
SHA: ${{ github.sha }}
ACTOR: ${{ github.actor }}
LOGS_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}