|
47 | 47 | if: always()
|
48 | 48 | run: |
|
49 | 49 | docker logs trino
|
| 50 | + - name: Generate Slack message |
| 51 | + id: message |
| 52 | + run: | |
| 53 | + output=$(docker exec trino \ |
| 54 | + java -Dorg.jline.terminal.dumb=true -jar /usr/bin/trino \ |
| 55 | + trino://localhost:8080/trinocicd/v2 \ |
| 56 | + --file /sql/ci-cd/health.sql \ |
| 57 | + --output-format=VERTICAL | tail -n+2) |
| 58 | +
|
| 59 | + EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) |
| 60 | + echo "health<<$EOF" >> $GITHUB_OUTPUT |
| 61 | + echo '```'"$output"'```' >> $GITHUB_OUTPUT |
| 62 | + echo "$EOF" >> $GITHUB_OUTPUT |
| 63 | +
|
| 64 | + output=$(docker exec trino \ |
| 65 | + java -Dorg.jline.terminal.dumb=true -jar /usr/bin/trino \ |
| 66 | + trino://localhost:8080/trinocicd/v2 \ |
| 67 | + --file /sql/ci-cd/failing-jobs.sql \ |
| 68 | + --output-format=CSV_UNQUOTED) |
| 69 | +
|
| 70 | + EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) |
| 71 | + echo "failing-jobs<<$EOF" >> $GITHUB_OUTPUT |
| 72 | + echo "$output" >> $GITHUB_OUTPUT |
| 73 | + echo "$EOF" >> $GITHUB_OUTPUT |
| 74 | + - name: Post to a Slack channel |
| 75 | + id: slack |
| 76 | + |
| 77 | + with: |
| 78 | + channel-id: 'tmp-reports' |
| 79 | + payload: | |
| 80 | + { |
| 81 | + "text": "CI health reports", |
| 82 | + "blocks": [ |
| 83 | + { |
| 84 | + "type": "header", |
| 85 | + "text": { |
| 86 | + "type": "plain_text", |
| 87 | + "text": "CI health" |
| 88 | + } |
| 89 | + }, |
| 90 | + { |
| 91 | + "type": "section", |
| 92 | + "text": { |
| 93 | + "type": "mrkdwn", |
| 94 | + "text": ${{ toJSON(steps.message.outputs.health) }} |
| 95 | + } |
| 96 | + }, |
| 97 | + { |
| 98 | + "type": "divider" |
| 99 | + }, |
| 100 | + { |
| 101 | + "type": "header", |
| 102 | + "text": { |
| 103 | + "type": "plain_text", |
| 104 | + "text": "Failing jobs" |
| 105 | + } |
| 106 | + }, |
| 107 | + { |
| 108 | + "type": "section", |
| 109 | + "text": { |
| 110 | + "type": "mrkdwn", |
| 111 | + "text": ${{ toJSON(steps.message.outputs.failing-jobs) }} |
| 112 | + } |
| 113 | + }, |
| 114 | + { |
| 115 | + "type": "context", |
| 116 | + "elements": [ |
| 117 | + { |
| 118 | + "type": "mrkdwn", |
| 119 | + "text": "See the complete <https://trinodb.github.io/reports/reports/flaky/|flaky jobs report>" |
| 120 | + } |
| 121 | + ] |
| 122 | + } |
| 123 | + ] |
| 124 | + } |
| 125 | + env: |
| 126 | + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |
0 commit comments