forked from cilium/cilium
-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (116 loc) · 4.64 KB
/
lint-bpf-checks.yaml
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: BPF checks
# Any change in triggers needs to be reflected in the concurrency group.
on:
pull_request: {}
push:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.after }}
cancel-in-progress: true
jobs:
check_changes:
name: Deduce required tests from code changes
runs-on: ubuntu-latest
outputs:
bpf-tree: ${{ steps.changes.outputs.bpf-tree }}
coccinelle: ${{ steps.changes.outputs.coccinelle }}
steps:
- name: Checkout code
if: ${{ !github.event.pull_request }}
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
persist-credentials: false
- name: Check code changes
uses: dorny/paths-filter@b2feaf19c27470162a626bd6fa8438ae5b263721
id: changes
with:
filters: |
bpf-tree:
- 'bpf/**'
coccinelle:
- 'contrib/coccinelle/**'
checkpatch:
name: checkpatch
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
persist-credentials: false
fetch-depth: 0
- name: Run checkpatch.pl
uses: docker://quay.io/cilium/cilium-checkpatch:514a240252e61d47b8814a5e57843505c0325b77@sha256:f88bbc4dbd8ace809c84581fae8b2dbbbc89433d641f1edf0f892d92be996020
- name: Send slack notification
if: ${{ (cancelled() || failure()) && (github.event_name == 'schedule' || github.event_name == 'push') }}
uses: 8398a7/action-slack@dcc8c8e9dd8802e21a712dc0c003db97b42efe43
with:
status: ${{ job.status }}
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message)
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
# Runs only if code under bpf/ or contrib/coccinnelle/ is changed.
coccicheck:
needs: check_changes
if: ${{ needs.check_changes.outputs.bpf-tree == 'true' || needs.check_changes.outputs.coccinelle == 'true' }}
name: coccicheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
persist-credentials: false
- uses: docker://cilium/coccicheck:2.0
with:
entrypoint: ./contrib/coccinelle/check-cocci.sh
- name: Send slack notification
if: ${{ (cancelled() || failure()) && (github.event_name == 'schedule' || github.event_name == 'push') }}
uses: 8398a7/action-slack@dcc8c8e9dd8802e21a712dc0c003db97b42efe43
with:
status: ${{ job.status }}
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message)
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
# Runs only if code under bpf/ is changed.
build_all:
needs: check_changes
if: ${{ needs.check_changes.outputs.bpf-tree == 'true' }}
name: build datapath
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@37335c7bb261b353407cff977110895fa0b4f7d8
with:
go-version: 1.16.5
- name: Cache LLVM and Clang
id: cache-llvm
uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353
with:
path: $HOME/.clang
key: llvm-10.0
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@94441eb6f611486ec059130719cca525263ac2be
with:
version: "10.0"
directory: $HOME/.clang
cached: ${{ steps.cache-llvm.outputs.cache-hit }}
- name: Checkout code
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
persist-credentials: false
fetch-depth: 0
- name: Build all BPF datapath permutations
env:
V: 0
run: |
make --quiet -C bpf build_all || (echo "Run 'make -C bpf build_all' locally to investigate build breakages"; exit 1)
- name: Run BPF_PROG_TEST_RUN tests
run: |
make -C bpf go_prog_test || (echo "Run 'make -C bpf go_prog_test' locally to investigate failures"; exit 1)
- name: Send slack notification
if: ${{ (cancelled() || failure()) && (github.event_name == 'schedule' || github.event_name == 'push') }}
uses: 8398a7/action-slack@dcc8c8e9dd8802e21a712dc0c003db97b42efe43
with:
status: ${{ job.status }}
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message)
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}