Skip to content

Commit

Permalink
update slack notification
Browse files Browse the repository at this point in the history
  • Loading branch information
tyitang committed Jul 17, 2024
1 parent 1763cdf commit a3d4b99
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 54 deletions.
44 changes: 17 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,35 +50,25 @@ jobs:
echo API_KEY=${{ secrets.API_KEY }} >> .env
test_env=sepolia npx playwright test
- name: Deploy report to GitHub Pages
if: always()
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./playwright-report-sepolia
publish_branch: gh-pages
keep_files: true

- name: Push Slack Notification
uses: slackapi/slack-github[email protected]
uses: storyprotocol/gha-workflows/.github/workflows/reusable-slack-notifs.yml@main
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID_API_INTEGRATION_TESTS }}
payload: |
{
"text": "${{ github.repository }}: API Integration Tests have been completed. Check the results at github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"blocks": [
{ "type": "divider" },
{
"type": "image",
"title": {
"type": "plain_text",
"text": "Playwright Test Results"
},
"image_url": "http://www.quickmeme.com/img/b9/b9848df257b95cd39585368475a4b4e4a3a8c774f7390226daecb79b912087ad.jpg",
"alt_text": "Playwright Test Results"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text":"${{ github.repository }}: API Integration Tests have been completed. \nCheck the results at https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
short-desc: "${{ github.repository }}: API Integration Tests have been completed. Check the results at https://storyprotocol.github.io/api-integration-tests/index.html"
title: "API Integration Test Results"
img-url: "http://www.quickmeme.com/img/b9/b9848df257b95cd39585368475a4b4e4a3a8c774f7390226daecb79b912087ad.jpg"
img-alt-text: "API Integration Test Results"
secrets:
channel-name: ${{ secrets.SLACK_CHANNEL_ID_API_INTEGRATION_TESTS }}
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}

- name: Upload Test Results
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
Expand Down
44 changes: 17 additions & 27 deletions .github/workflows/prod-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,35 +39,25 @@ jobs:
echo API_KEY=${{ secrets.API_KEY_PROD }} >> .env
test_env=sepolia npx playwright test
- name: Deploy report to GitHub Pages
if: always()
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./playwright-report-sepolia
publish_branch: gh-pages
keep_files: true

- name: Push Slack Notification
uses: slackapi/slack-github[email protected]
uses: storyprotocol/gha-workflows/.github/workflows/reusable-slack-notifs.yml@main
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID_API_INTEGRATION_TESTS }}
payload: |
{
"text": "${{ github.repository }}: API Testing for Prod Endpoint have been completed. Check the results at github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"blocks": [
{ "type": "divider" },
{
"type": "image",
"title": {
"type": "plain_text",
"text": "Playwright Test Results"
},
"image_url": "http://www.quickmeme.com/img/b9/b9848df257b95cd39585368475a4b4e4a3a8c774f7390226daecb79b912087ad.jpg",
"alt_text": "Playwright Test Results"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text":"${{ github.repository }}: API Testing for Prod Endpoint have been completed. \nCheck the results at https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
short-desc: "${{ github.repository }}: API Integration Tests of Prod have been completed. Check the results at https://storyprotocol.github.io/api-integration-tests/index.html"
title: "API Integration Test Results of Prod"
img-url: "http://www.quickmeme.com/img/b9/b9848df257b95cd39585368475a4b4e4a3a8c774f7390226daecb79b912087ad.jpg"
img-alt-text: "API Integration Test Results"
secrets:
channel-name: ${{ secrets.SLACK_CHANNEL_ID_API_INTEGRATION_TESTS }}
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}

- name: Upload Test Results
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
Expand Down

0 comments on commit a3d4b99

Please sign in to comment.