Skip to content

Commit

Permalink
Workflow: Notify tests results on slack channel (#1744)
Browse files Browse the repository at this point in the history
* Update tests-main.yml

* Update docker-build.yml
  • Loading branch information
younesbelkada authored Jun 17, 2024
1 parent f5168fd commit 2d244f8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 69 deletions.
60 changes: 14 additions & 46 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,30 +45,14 @@ jobs:
push: true
tags: huggingface/trl-latest-gpu

- name: Post to a Slack channel
id: slack
#uses: slackapi/[email protected]
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001
- name: Post to Slack
if: always()
uses: huggingface/hf-workflows/.github/actions/post-slack@main
with:
# Slack channel id, channel name, or user id to post message.
# See also: https://api.slack.com/methods/chat.postMessage#channels
channel-id: ${{ env.CI_SLACK_CHANNEL }}
# For posting a rich message using Block Kit
payload: |
{
"text": "trl-latest-gpu Docker Image build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "trl-latest-gpu Docker Image build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
slack_channel: ${{ env.CI_SLACK_CHANNEL }}
title: 🤗 Results of the trl-latest-gpu Docker Image build
status: ${{ job.status }}
slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}

trl-source:
name: "Latest TRL + HF ecosystem from source"
Expand Down Expand Up @@ -101,27 +85,11 @@ jobs:
push: true
tags: huggingface/trl-source-gpu

- name: Post to a Slack channel
id: slack
#uses: slackapi/[email protected]
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001
- name: Post to Slack
if: always()
uses: huggingface/hf-workflows/.github/actions/post-slack@main
with:
# Slack channel id, channel name, or user id to post message.
# See also: https://api.slack.com/methods/chat.postMessage#channels
channel-id: ${{ env.CI_SLACK_CHANNEL }}
# For posting a rich message using Block Kit
payload: |
{
"text": "trl-source-gpu Docker Image build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "trl-source-gpu Docker Image build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
slack_channel: ${{ env.CI_SLACK_CHANNEL }}
title: 🤗 Results of the trl-source-gpu Docker Image build
status: ${{ job.status }}
slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
29 changes: 6 additions & 23 deletions .github/workflows/tests-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,11 @@ jobs:
- name: Test with pytest
run: |
make test
- name: Post to a Slack channel
- name: Post to Slack
if: always()
id: slack
#uses: slackapi/[email protected]
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001
uses: huggingface/hf-workflows/.github/actions/post-slack@main
with:
# Slack channel id, channel name, or user id to post message.
# See also: https://api.slack.com/methods/chat.postMessage#channels
channel-id: ${{ env.CI_SLACK_CHANNEL }}
# For posting a rich message using Block Kit
payload: |
{
"text": "TRL CI on transformers/PEFT main: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "TRL CI on transformers/PEFT main: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
slack_channel: ${{ env.CI_SLACK_CHANNEL }}
title: 🤗 Results of the TRL CI on transformers/PEFT main
status: ${{ job.status }}
slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}

0 comments on commit 2d244f8

Please sign in to comment.