Skip to content

Commit 4abf742

Browse files
author
fborello-lambda
committed
feat: hive diff msg only on change
1 parent 30e3718 commit 4abf742

File tree

3 files changed

+40
-27
lines changed

3 files changed

+40
-27
lines changed

.github/scripts/publish_hive.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
curl -X POST $1 \
22
-H 'Content-Type: application/json; charset=utf-8' \
33
--data @- <<EOF
4-
$(jq -n --arg text "$(cat results.md)" '{
4+
$(jq -n --arg text "$(cat results_revm.md)" '{
55
"blocks": [
66
{
77
"type": "header",

.github/scripts/publish_levm_hive.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
curl -X POST $1 \
22
-H 'Content-Type: application/json; charset=utf-8' \
33
--data @- <<EOF
4-
$(jq -n --arg text "$(cat results.md)" '{
4+
$(jq -n --arg text "$(cat results_levm.md)" '{
55
"blocks": [
66
{
77
"type": "header",

.github/workflows/daily_reports.yaml

Lines changed: 38 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
if-no-files-found: error
6363

6464
hive-report:
65-
name: Generate report and upload to Slack (${{ matrix.vm }})
65+
name: Generate and Save report (${{ matrix.vm }})
6666
needs: run-hive
6767
runs-on: ubuntu-latest
6868
strategy:
@@ -102,28 +102,6 @@ jobs:
102102
echo "# Hive coverage report (${{ matrix.vm }})" >> $GITHUB_STEP_SUMMARY
103103
cat results.md >> $GITHUB_STEP_SUMMARY
104104
105-
- name: Post results to Slack
106-
env:
107-
SLACK_WEBHOOKS: >
108-
${{ github.event_name == 'workflow_dispatch'
109-
&& secrets.TEST_CHANNEL_SLACK
110-
|| format(
111-
'{0} {1} {2}',
112-
secrets.ETHREX_L1_SLACK_WEBHOOK,
113-
secrets.ETHREX_L2_SLACK_WEBHOOK,
114-
secrets.LEVM_SLACK_WEBHOOK
115-
)
116-
}}
117-
SCRIPT: >
118-
${{ matrix.vm == 'levm'
119-
&& '.github/scripts/publish_levm_hive.sh'
120-
|| '.github/scripts/publish_hive.sh'
121-
}}
122-
run: |
123-
for webhook in $SLACK_WEBHOOKS; do
124-
sh $SCRIPT "$webhook"
125-
done
126-
127105
hive-diff-report:
128106
name: Post tests diff to levm slack
129107
needs: hive-report
@@ -148,7 +126,7 @@ jobs:
148126
- name: Rename result (2)
149127
run: cp results.md results_revm.md
150128

151-
- name: Post results diff to Slack
129+
- name: Create diff message
152130
env:
153131
SLACK_WEBHOOK: >
154132
${{ github.event_name == 'workflow_dispatch'
@@ -158,7 +136,42 @@ jobs:
158136
run: |
159137
bash .github/scripts/levm_revm_diff.sh results_revm.md results_levm.md >> diff.md
160138
cat diff.md >> $GITHUB_STEP_SUMMARY
161-
sh .github/scripts/publish_vms_diff.sh $SLACK_WEBHOOK
139+
140+
- name: Post results to Slack
141+
env:
142+
SLACK_WEBHOOKS: >
143+
${{ github.event_name == 'workflow_dispatch'
144+
&& secrets.TEST_CHANNEL_SLACK
145+
|| format(
146+
'{0} {1} {2}',
147+
secrets.ETHREX_L1_SLACK_WEBHOOK,
148+
secrets.ETHREX_L2_SLACK_WEBHOOK,
149+
secrets.LEVM_SLACK_WEBHOOK
150+
)
151+
}}
152+
run: |
153+
for webhook in $SLACK_WEBHOOKS; do
154+
sh .github/scripts/publish_levm_hive.sh "$webhook"
155+
sh .github/scripts/publish_hive.sh "$webhook"
156+
done
157+
echo "Sending Results" >> $GITHUB_STEP_SUMMARY
158+
159+
- name: Post results diff to Slack
160+
env:
161+
SLACK_WEBHOOK: >
162+
${{ github.event_name == 'workflow_dispatch'
163+
&& secrets.TEST_CHANNEL_SLACK
164+
|| secrets.LEVM_SLACK_WEBHOOK
165+
}}
166+
# Only send diff message if the diff has changed
167+
run: |
168+
DIFF_CONTENT=$(cat diff.md)
169+
if [ "$DIFF_CONTENT" == "No differences found" ]; then
170+
echo "No differences to post" >> $GITHUB_STEP_SUMMARY
171+
else
172+
sh .github/scripts/publish_vms_diff.sh $SLACK_WEBHOOK
173+
echo "Sending Results" >> $GITHUB_STEP_SUMMARY
174+
fi
162175
163176
levm-test:
164177
name: Generate Report for LEVM EF Tests

0 commit comments

Comments
 (0)