Skip to content

Commit 292f7c4

Browse files
authored
Merge pull request #540 from storyprotocol/feat/bp/workflows-improvements
Test Workflow Improvements
2 parents 7c249ef + df270b3 commit 292f7c4

File tree

3 files changed

+22
-20
lines changed

3 files changed

+22
-20
lines changed

.github/workflows/pr-external.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
needs: [authorize]
2323
uses: storyprotocol/gha-workflows/.github/workflows/reusable-timestamp.yml@main
2424

25-
pr_build_and_test:
25+
unit_tests:
2626
needs: [authorize, Timestamp_PR_APPROVED]
2727
uses: storyprotocol/gha-workflows/.github/workflows/reusable-build-unit-test-workflow.yml@main
2828
with:
@@ -32,8 +32,8 @@ jobs:
3232
WALLET_PRIVATE_KEY: ${{ secrets.WALLET_PRIVATE_KEY }}
3333
TEST_WALLET_ADDRESS: ${{ secrets.TEST_WALLET_ADDRESS }}
3434

35-
push_build_and_test:
36-
needs: [pr_build_and_test]
35+
integration_tests:
36+
needs: [unit_tests]
3737
uses: storyprotocol/gha-workflows/.github/workflows/reusable-build-integration-test-workflow.yml@main
3838
with:
3939
sha: ${{ github.event.pull_request.head.sha }}

.github/workflows/pr-internal.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@ jobs:
1313
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
1414
uses: storyprotocol/gha-workflows/.github/workflows/reusable-timestamp.yml@main
1515

16-
pr_build_and_test:
17-
if: github.event_name == 'pull_request'
16+
unit_tests:
1817
needs: [Timestamp]
1918
uses: storyprotocol/gha-workflows/.github/workflows/reusable-build-unit-test-workflow.yml@main
2019
with:
21-
sha: ${{ github.event.pull_request.head.sha }}
20+
sha: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
2221
ENVIRONMENT: "odyssey"
2322
secrets:
2423
WALLET_PRIVATE_KEY: ${{ secrets.WALLET_PRIVATE_KEY }}
2524
TEST_WALLET_ADDRESS: ${{ secrets.TEST_WALLET_ADDRESS }}
2625

27-
push_build_and_test:
28-
if: github.event_name == 'push'
26+
integration_tests:
27+
if: github.event_name == 'pull_request'
28+
needs: [Timestamp]
2929
uses: storyprotocol/gha-workflows/.github/workflows/reusable-build-integration-test-workflow.yml@main
3030
with:
31-
sha: ${{ github.sha }}
31+
sha: ${{ github.event.pull_request.head.sha }}
3232
ENVIRONMENT: "odyssey"
3333
secrets:
3434
WALLET_PRIVATE_KEY: ${{ secrets.WALLET_PRIVATE_KEY }}

.github/workflows/publish-package.yaml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,17 @@ jobs:
119119
npm publish
120120
env:
121121
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
122-
122+
123123
send_slack_notif-core-sdk:
124-
needs: [print_version_to_publish]
125-
uses: storyprotocol/gha-workflows/.github/workflows/reusable-slack-notifs.yml@main
126-
with:
127-
short-desc: "${{ github.repository }}: @story-protocol/core-sdk package has been published to NPM Registry, version: ${{ needs.print_version_to_publish.outputs.CORE_SDK_VERSION_TO_BE_PUBLISHED}}"
128-
title: "Published to Registry"
129-
img-url: "https://i.imgur.com/JHmKB0s.png"
130-
img-alt-text: "Published to Registry"
131-
secrets:
132-
channel-name: ${{ secrets.SLACK_CHANNEL_ID_STORY_57BLOCKS }}
133-
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
124+
runs-on: ubuntu-latest
125+
environment: "odyssey"
126+
steps:
127+
- name: Send Slack Notification
128+
run: |
129+
curl -X POST \
130+
-H 'Content-type: application/json' \
131+
--data '{
132+
"channel": "proj-sdk",
133+
"text":"${{ github.repository }}: @story-protocol/core-sdk package has been published to NPM Registry, version: ${{ needs.print_version_to_publish.outputs.CORE_SDK_VERSION_TO_BE_PUBLISHED}}"
134+
}' \
135+
${{ secrets.SLACK_SDK_MESSENGER_WEBHOOK_URL }}

0 commit comments

Comments
 (0)