Skip to content

Commit

Permalink
Merge pull request #32 from storyprotocol/update-notification
Browse files Browse the repository at this point in the history
Update notification
  • Loading branch information
AndyBoWu committed Jul 17, 2024
2 parents 1763cdf + 2fcf2cf commit 5c467fb
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 56 deletions.
47 changes: 19 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,35 +50,14 @@ jobs:
echo API_KEY=${{ secrets.API_KEY }} >> .env
test_env=sepolia npx playwright test
- name: Push Slack Notification
uses: slackapi/[email protected]
- name: Deploy report to GitHub Pages
if: always()
uses: peaceiris/actions-gh-pages@v4
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 }}
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./playwright-report-sepolia
publish_branch: gh-pages
keep_files: true

- name: Upload Test Results
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
Expand All @@ -87,3 +66,15 @@ jobs:
name: sepolia-test-reports
path: |
./playwright-report-sepolia/index.html
push-slack-notification:
name: Push Slack Notification
uses: storyprotocol/gha-workflows/.github/workflows/reusable-slack-notifs.yml@main
with:
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 }}
48 changes: 20 additions & 28 deletions .github/workflows/prod-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,39 +39,31 @@ jobs:
echo API_KEY=${{ secrets.API_KEY_PROD }} >> .env
test_env=sepolia npx playwright test
- name: Push Slack Notification
uses: slackapi/[email protected]
- name: Deploy report to GitHub Pages
if: always()
uses: peaceiris/actions-gh-pages@v4
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 }}
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./playwright-report-sepolia
publish_branch: gh-pages
keep_files: true

- name: Upload Test Results
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
# if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
name: sepolia-test-reports
path: |
./playwright-report-sepolia/index.html
push-slack-notification:
name: Push Slack Notification
uses: storyprotocol/gha-workflows/.github/workflows/reusable-slack-notifs.yml@main
with:
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 }}

0 comments on commit 5c467fb

Please sign in to comment.