Skip to content

Commit

Permalink
Add notification after integration tests & fix the workflow badge (#130)
Browse files Browse the repository at this point in the history
* add "notification" step in integration tests workflow

* better messages

* Rename "telegram notify" workflow

* fix badge link in readmes
  • Loading branch information
MorrisNein authored Jun 20, 2023
1 parent d34288e commit 522878e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/integration-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,13 @@ jobs:
- name: Test with pytest
run: |
pytest --cov=golem -s test/integration
- name: Notify telegram bot
uses: appleboy/telegram-action@master
if: failure() && ${{ github.event_name == 'schedule' }}
with:
to: ${{ secrets.TELEGRAM_CHAT_ID }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: "${{ github.event.repository.name }}: scheduled integration tests
[were failed](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})."
format: markdown
disable_web_page_preview: true
17 changes: 11 additions & 6 deletions .github/workflows/notify.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: telegram notify
name: PR merge/close notification
on:
pull_request:
types: [ closed ]
Expand All @@ -15,12 +15,15 @@ jobs:
with:
to: ${{ secrets.TELEGRAM_CHAT_ID }}
token: ${{ secrets.TELEGRAM_TOKEN }}
args: "The ${{github.event_name}} '${{github.event.pull_request.title}}' (#${{github.event.number}}) was merged.
\nLink: ${{github.event.pull_request.html_url}}
\nDescription: ${{github.event.pull_request.body}}
message: "${{ github.event.repository.name }}:
the ${{ github.event_name }} '${{ github.event.pull_request.title }}'
(#${{ github.event.number }}) was merged.
\n[Link](${{ github.event.pull_request.html_url }}).
\nDescription:\n${{ github.event.pull_request.body }}
\n
\nCheck it out to keep your local repository updated."

format: markdown
disable_web_page_preview: true

close_job:
if: github.event.pull_request.merged == false
Expand All @@ -32,4 +35,6 @@ jobs:
with:
to: ${{ secrets.TELEGRAM_CHAT_ID }}
token: ${{ secrets.TELEGRAM_TOKEN }}
args: The ${{github.event_name}} ${{github.event.pull_request.title}} (${{github.event.number}}) was closed.
message: "${{ github.event.repository.name }}:
the ${{ github.event_name }} ${{ github.event.pull_request.title }}
(${{ github.event.number }}) was closed."
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ GOLEM можно установить с помощью ``pip``:
:alt: Build Status
:target: https://github.com/aimclub/GOLEM/actions/workflows/unit-build.yml

.. |integration| image:: https://github.com/aimclub/GOLEM/workflows/integration-build.yml/badge.svg?branch=main
.. |integration| image:: https://github.com/aimclub/GOLEM/actions/workflows/integration-build.yml/badge.svg?branch=main
:alt: Integration Build Status
:target: https://github.com/aimclub/GOLEM/actions/workflows/integration-build.yml

Expand Down
2 changes: 1 addition & 1 deletion README_en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ There are various cases solved with GOLEM's algorithms:
:alt: Build Status
:target: https://github.com/aimclub/GOLEM/actions/workflows/unit-build.yml

.. |integration| image:: https://github.com/aimclub/GOLEM/workflows/integration-build.yml/badge.svg?branch=main
.. |integration| image:: https://github.com/aimclub/GOLEM/actions/workflows/integration-build.yml/badge.svg?branch=main
:alt: Integration Build Status
:target: https://github.com/aimclub/GOLEM/actions/workflows/integration-build.yml

Expand Down

0 comments on commit 522878e

Please sign in to comment.