-
Notifications
You must be signed in to change notification settings - Fork 25
75 lines (65 loc) · 2.53 KB
/
check-drivers-failures.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Check driver failures
on:
workflow_call:
inputs:
logs-artifact:
required: true
type: string
description: |
Artifact name where driver build logs have been stored.
jobs:
check-failures:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Restore failure files
uses: actions/download-artifact@v4
with:
pattern: ${{ inputs.logs-artifact }}
merge-multiple: true
path: /tmp/FAILURES
- name: Check build failures
run: |
set -eo pipefail
FAILURES_DIR=${FAILURES_DIR:-/tmp/FAILURES}
shopt -s nullglob
cd "$FAILURES_DIR"
failure_files=(*/*/*.log)
for failure_file in "${failure_files[@]}"; do
if [[ "$failure_file" =~ ^([^/]+)/([^/]+)/([^/]+)\.log$ ]]; then
# If the file is empty, there's nothing to alert on. Sometimes kernels
# that don't support eBPF leave the error file hanging around for no
# good reason (I suspect some shenanigan's with tee spawning after we
# mark the file for deletion).
if [[ ! -s "$failure_file" ]]; then
rm -f "$failure_file"
continue
fi
kernel_version="${BASH_REMATCH[1]}"
module_version="${BASH_REMATCH[2]}"
probe_type="${BASH_REMATCH[3]}"
echo >&2 "============================================================================"
echo >&2 "Failed to build ${probe_type} probe"
echo >&2 "Module version: ${module_version}"
echo >&2 "Kernel version: ${kernel_version}"
echo >&2
cat >&2 "$failure_file"
echo >&2
echo >&2
fi
done
# We expand it again to ignore empty files.
failure_files=(*/*/*.log)
[[ "${#failure_files[@]}" == 0 ]]
- name: Slack notification
if: failure() && github.event_name != 'pull_request'
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_COLLECTOR_ONCALL_WEBHOOK }}
SLACK_CHANNEL: team-acs-collector-oncall
SLACK_COLOR: ${{ job.status }}
SLACK_LINK_NAMES: true
SLACK_TITLE: Driver build check failed
MSG_MINIMAL: actions url,commit
SLACK_MESSAGE: |
@acs-collector-oncall