Skip to content

Commit

Permalink
chore: fix multiline slack report for weekly CI
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanBredehoft committed May 28, 2024
1 parent e7d6c60 commit 5a6eabd
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 7 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1174,23 +1174,31 @@ jobs:
# FIXME: https://github.com/zama-ai/concrete-ml-internal/issues/4428
- name: Set message body
run: |
SLACK_BODY="Build status ([Action URL](${{ env.ACTION_RUN_URL }})):\n\
- Linux: ${{ needs.build-linux.result }}\n\n\
- macOS (intel): ${{ needs.build-macos-intel.result }}\n\n"
{
echo "SLACK_BODY<<EOF"
echo "Build status ([Action URL](${{ env.ACTION_RUN_URL }})):"
echo " - Linux: ${{ needs.build-linux.result }}"
echo " - macOS (intel): ${{ needs.build-macos-intel.result }}"
} >> $GITHUB_ENV
LINUX_PYTHON_VERSIONS="${{ needs.matrix-preparation.outputs.linux-python-versions }}"
for linux_python_version in ${LINUX_PYTHON_VERSIONS}; do
file_name="failed_tests_slack_list_${linux_python_version}.txt"
if [ -f ${file_name} ]; then
SLACK_BODY+="Linux failed tests (Python ${linux_python_version}):\n"
SLACK_BODY+="$(cat ${file_name})"
SLACK_BODY+="\n\n"
FAILED_TESTS_LIST=$(cat "${file_name}")
{
echo ""
echo ""
echo "Linux failed tests (Python ${linux_python_version}):"
echo "${FAILED_TESTS_LIST}"
} >> $GITHUB_ENV
fi
done
echo "SLACK_BODY=${SLACK_BODY}" >> "$GITHUB_ENV"
echo "EOF" >> $GITHUB_ENV
- name: Slack report
uses: rtCamp/action-slack-notify@4e5fb42d249be6a45a298f3c9543b111b02f7907
Expand Down
36 changes: 36 additions & 0 deletions test_new.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version="3.8"
file_name="failed_tests_slack_list_38.txt"

if [ -z "$GITHUB_ENV" ]; then
GITHUB_ENV=$(mktemp)
fi

{
echo "SLACK_BODY<<EOF"
echo "Build status ([Action URL](Action url)):"
echo " - Linux: skipped"
echo " - macOS (intel): skipped"
} >> $GITHUB_ENV

LINUX_PYTHON_VERSIONS="38"

for linux_python_version in ${LINUX_PYTHON_VERSIONS}; do
file_name="failed_tests_slack_list_${linux_python_version}.txt"

if [ -f ${file_name} ]; then
FAILED_TESTS_LIST=$(cat "${file_name}")

{
echo ""
echo ""
echo "Linux failed tests (Python ${linux_python_version}):"
echo "${FAILED_TESTS_LIST}"
} >> $GITHUB_ENV
fi
done

echo "EOF" >> $GITHUB_ENV


cat $GITHUB_ENV
rm $GITHUB_ENV

0 comments on commit 5a6eabd

Please sign in to comment.