diff --git a/.github/workflows/testsPython.yml b/.github/workflows/testsPython.yml index 452f71d..f5b3744 100644 --- a/.github/workflows/testsPython.yml +++ b/.github/workflows/testsPython.yml @@ -68,12 +68,44 @@ jobs: # on the test results. notifications: needs: python-unit-tests + if: always() runs-on: ubuntu-latest steps: + # Notifications in Job Summary panel of the workflow run - name: Notify on test results run: | if [ "${{ needs.python-unit-tests.result }}" == "success" ]; then - echo "success notifications go here" + echo "## Tests Passed ✅" >> $GITHUB_STEP_SUMMARY + echo "All unit tests succeeded." >> $GITHUB_STEP_SUMMARY else - echo "failure notifications go here" + echo "## Tests Failed ❌" >> $GITHUB_STEP_SUMMARY + echo "Check logs for details." >> $GITHUB_STEP_SUMMARY fi + # Email notification using Brevo when tests pass, BREVO_API_KEY is set in repository secrets + - name: Send success email + if: ${{ needs.python-unit-tests.result == 'success' }} + run: | + curl -X POST https://api.brevo.com/v3/smtp/email \ + -H "accept: application/json" \ + -H "api-key: ${{ secrets.BREVO_API_KEY }}" \ + -H "content-type: application/json" \ + -d '{ + "sender": { "email": "info@runningresults.net" }, + "to": [{ "email": "yongchuangchen@gmail.com" }], + "subject": "Tests Passed ✅", + "htmlContent": "
All tests passed successfully.
" + }' + # Email notification using Brevo when tests fail, BREVO_API_KEY is set in repository secrets + - name: Send failure email + if: ${{ needs.python-unit-tests.result == 'failure' }} + run: | + curl -X POST https://api.brevo.com/v3/smtp/email \ + -H "accept: application/json" \ + -H "api-key: ${{ secrets.BREVO_API_KEY }}" \ + -H "content-type: application/json" \ + -d '{ + "sender": { "email": "info@runningresults.net" }, + "to": [{ "email": "yongchuangchen@gmail.com" }], + "subject": "Tests Failed ❌", + "htmlContent": "Tests failed. Check logs in GitHub Actions.
" + }' diff --git a/agentic-ai-workflow.code-workspace b/agentic-ai-workflow.code-workspace new file mode 100644 index 0000000..ef9f5d2 --- /dev/null +++ b/agentic-ai-workflow.code-workspace @@ -0,0 +1,7 @@ +{ + "folders": [ + { + "path": "." + } + ] +} \ No newline at end of file