diff --git a/.github/scripts/publish_levm_ef_tests_summary.sh b/.github/scripts/publish_levm_ef_tests_summary.sh index 0d5591ff5..470a3db4b 100644 --- a/.github/scripts/publish_levm_ef_tests_summary.sh +++ b/.github/scripts/publish_levm_ef_tests_summary.sh @@ -1,25 +1,3 @@ curl -X POST $url \ -H 'Content-Type: application/json; charset=utf-8' \ ---data @- < String { let total_run = reports.len(); let success_percentage = (total_passed as f64 / total_run as f64) * 100.0; format!( - r#""*Summary*: {total_passed}/{total_run} ({success_percentage:.2}%)\n\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n""#, + r#"{{ + "blocks": [ + {{ + "type": "header", + "text": {{ + "type": "plain_text", + "text": "Daily LEVM EF Tests Run Report" + }} + }}, + {{ + "type": "divider" + }}, + {{ + "type": "section", + "text": {{ + "type": "mrkdwn", + "text": "*Summary*: {total_passed}/{total_run} ({success_percentage:.2}%)\n\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n" + }} + }} + ] +}}"#, fork_summary_for_slack(reports, SpecId::CANCUN), fork_summary_for_slack(reports, SpecId::SHANGHAI), fork_summary_for_slack(reports, SpecId::HOMESTEAD), diff --git a/cmd/loc/src/main.rs b/cmd/loc/src/main.rs index 78b33bee2..83435dda7 100644 --- a/cmd/loc/src/main.rs +++ b/cmd/loc/src/main.rs @@ -67,30 +67,50 @@ fn slack_message(old_report: LinesOfCodeReport, new_report: LinesOfCodeReport) - let ethrex_diff_total = ethrex_l1_diff + ethrex_l2_diff + levm_diff; format!( - r#""*ethrex L1:* {} {}\n*ethrex L2:* {} {}\n*levm:* {} {}\n*ethrex (total):* {} {}""#, + r#"{{ + "blocks": [ + {{ + "type": "header", + "text": {{ + "type": "plain_text", + "text": "Daily LEVM EF Tests Run Report" + }} + }}, + {{ + "type": "divider" + }}, + {{ + "type": "section", + "text": {{ + "type": "mrkdwn", + "text": "*ethrex L1:* {} {}\n*ethrex L2:* {} {}\n*levm:* {} {}\n*ethrex (total):* {} {}" + }} + }} + ] +}}"#, new_report.ethrex_l1, - if new_report.ethrex > old_report.ethrex { - format!("(+{ethrex_l1_diff})") - } else { - format!("(-{ethrex_l1_diff})") + match new_report.ethrex_l1.cmp(&old_report.ethrex_l1) { + std::cmp::Ordering::Greater => format!("(+{ethrex_l1_diff})"), + std::cmp::Ordering::Less => format!("(-{ethrex_l1_diff})"), + std::cmp::Ordering::Equal => "".to_string(), }, new_report.ethrex_l2, - if new_report.ethrex_l2 > old_report.ethrex_l2 { - format!("(+{ethrex_l2_diff})") - } else { - format!("(-{ethrex_l2_diff})") + match new_report.ethrex_l2.cmp(&old_report.ethrex_l2) { + std::cmp::Ordering::Greater => format!("(+{ethrex_l2_diff})"), + std::cmp::Ordering::Less => format!("(-{ethrex_l2_diff})"), + std::cmp::Ordering::Equal => "".to_string(), }, new_report.levm, - if new_report.levm > old_report.levm { - format!("(+{levm_diff})") - } else { - format!("(-{levm_diff})") + match new_report.levm.cmp(&old_report.levm) { + std::cmp::Ordering::Greater => format!("(+{levm_diff})"), + std::cmp::Ordering::Less => format!("(-{levm_diff})"), + std::cmp::Ordering::Equal => "".to_string(), }, new_report.ethrex, - if new_report.ethrex > old_report.ethrex { - format!("(+{ethrex_diff_total})") - } else { - format!("(-{ethrex_diff_total})") + match new_report.ethrex.cmp(&old_report.ethrex) { + std::cmp::Ordering::Greater => format!("(+{ethrex_diff_total})"), + std::cmp::Ordering::Less => format!("(-{ethrex_diff_total})"), + std::cmp::Ordering::Equal => "".to_string(), }, ) }