Skip to content

Commit 2d244f8

Browse files
Workflow: Notify tests results on slack channel (#1744)
* Update tests-main.yml * Update docker-build.yml
1 parent f5168fd commit 2d244f8

File tree

2 files changed

+20
-69
lines changed

2 files changed

+20
-69
lines changed

.github/workflows/docker-build.yml

Lines changed: 14 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -45,30 +45,14 @@ jobs:
4545
push: true
4646
tags: huggingface/trl-latest-gpu
4747

48-
- name: Post to a Slack channel
49-
id: slack
50-
#uses: slackapi/[email protected]
51-
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001
48+
- name: Post to Slack
49+
if: always()
50+
uses: huggingface/hf-workflows/.github/actions/post-slack@main
5251
with:
53-
# Slack channel id, channel name, or user id to post message.
54-
# See also: https://api.slack.com/methods/chat.postMessage#channels
55-
channel-id: ${{ env.CI_SLACK_CHANNEL }}
56-
# For posting a rich message using Block Kit
57-
payload: |
58-
{
59-
"text": "trl-latest-gpu Docker Image build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}",
60-
"blocks": [
61-
{
62-
"type": "section",
63-
"text": {
64-
"type": "mrkdwn",
65-
"text": "trl-latest-gpu Docker Image build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
66-
}
67-
}
68-
]
69-
}
70-
env:
71-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
52+
slack_channel: ${{ env.CI_SLACK_CHANNEL }}
53+
title: 🤗 Results of the trl-latest-gpu Docker Image build
54+
status: ${{ job.status }}
55+
slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
7256

7357
trl-source:
7458
name: "Latest TRL + HF ecosystem from source"
@@ -101,27 +85,11 @@ jobs:
10185
push: true
10286
tags: huggingface/trl-source-gpu
10387

104-
- name: Post to a Slack channel
105-
id: slack
106-
#uses: slackapi/[email protected]
107-
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001
88+
- name: Post to Slack
89+
if: always()
90+
uses: huggingface/hf-workflows/.github/actions/post-slack@main
10891
with:
109-
# Slack channel id, channel name, or user id to post message.
110-
# See also: https://api.slack.com/methods/chat.postMessage#channels
111-
channel-id: ${{ env.CI_SLACK_CHANNEL }}
112-
# For posting a rich message using Block Kit
113-
payload: |
114-
{
115-
"text": "trl-source-gpu Docker Image build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}",
116-
"blocks": [
117-
{
118-
"type": "section",
119-
"text": {
120-
"type": "mrkdwn",
121-
"text": "trl-source-gpu Docker Image build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
122-
}
123-
}
124-
]
125-
}
126-
env:
127-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
92+
slack_channel: ${{ env.CI_SLACK_CHANNEL }}
93+
title: 🤗 Results of the trl-source-gpu Docker Image build
94+
status: ${{ job.status }}
95+
slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}

.github/workflows/tests-main.yml

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -36,28 +36,11 @@ jobs:
3636
- name: Test with pytest
3737
run: |
3838
make test
39-
- name: Post to a Slack channel
39+
- name: Post to Slack
4040
if: always()
41-
id: slack
42-
#uses: slackapi/[email protected]
43-
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001
41+
uses: huggingface/hf-workflows/.github/actions/post-slack@main
4442
with:
45-
# Slack channel id, channel name, or user id to post message.
46-
# See also: https://api.slack.com/methods/chat.postMessage#channels
47-
channel-id: ${{ env.CI_SLACK_CHANNEL }}
48-
# For posting a rich message using Block Kit
49-
payload: |
50-
{
51-
"text": "TRL CI on transformers/PEFT main: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}",
52-
"blocks": [
53-
{
54-
"type": "section",
55-
"text": {
56-
"type": "mrkdwn",
57-
"text": "TRL CI on transformers/PEFT main: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
58-
}
59-
}
60-
]
61-
}
62-
env:
63-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
43+
slack_channel: ${{ env.CI_SLACK_CHANNEL }}
44+
title: 🤗 Results of the TRL CI on transformers/PEFT main
45+
status: ${{ job.status }}
46+
slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}

0 commit comments

Comments
 (0)