diff --git a/.env.example b/.env.example index 568a4d2..aed7d13 100644 --- a/.env.example +++ b/.env.example @@ -12,3 +12,4 @@ MYSQL_DATABASE=smarter_test_db MYSQL_CHARSET=utf8mb4 PYTHONPATH=./venv:./ CODECOV_TOKEN=ADD-YOUR-CODECOV_TOKEN-HERE +REPO_NAME=ADD-YOUR-REPO_NAME-HERE 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/.vscode/settings.json b/.vscode/settings.json index 3a4d3c9..67ab810 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,5 +2,6 @@ "cornflakes.linter.executablePath": "venv/bin/flake8", "[python]": { "editor.defaultFormatter": "ms-python.black-formatter" - } + }, + "makefile.configureOnOpen": false } diff --git a/README.md b/README.md index 28065c8..7d54af7 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,8 @@ make docker-push # push your Docker container to DockerHub. A DockerHub accou make docker-prune # prune (permanently delete) all existing data in Docker: containers, images, cache. ``` +update: README + ## Requirements - [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git). _pre-installed on Linux and macOS_ 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