-
Notifications
You must be signed in to change notification settings - Fork 26
173 lines (167 loc) · 6.45 KB
/
Copy pathcheck.yml
File metadata and controls
173 lines (167 loc) · 6.45 KB
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2023 Robin Jarry
---
name: Check
permissions:
contents: read
on:
workflow_call:
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-and-tests:
if: ${{ github.actor != 'grout-bot' }}
permissions:
actions: write
strategy:
fail-fast: false
matrix:
conf:
- compiler: gcc-13
dpdk: '25.11'
frr: '10.5'
rebase: true
- compiler: gcc-14
dpdk: '25.11'
frr: '10.5'
asan: true
debug: true
- compiler: gcc-14
frr: '10.5'
dpdk: '25.11'
arch: aarch64
- compiler: gcc-14
dpdk: '25.11'
frr: '10.6'
- compiler: gcc-14
dpdk: '25.11-head'
frr: '10.5'
- compiler: gcc-14
dpdk: 'main'
frr: '10.5'
allow_fail: true
- compiler: gcc-14
dpdk: '25.11'
frr: 'master'
allow_fail: true
- compiler: clang-16
dpdk: '25.11'
frr: '10.5'
- compiler: clang-18
dpdk: '25.11'
frr: '10.5'
name: build-and-tests (${{ matrix.conf.arch || 'x86_64' }}, ${{ matrix.conf.compiler }}, DPDK ${{ matrix.conf.dpdk }}, FRR ${{ matrix.conf.frr }})
runs-on: ubuntu-24.04${{ matrix.conf.arch == 'aarch64' && '-arm' || '' }}
continue-on-error: ${{ matrix.conf.allow_fail || false }}
env:
SANITIZE: ${{ case(matrix.conf.asan || false, 'address', 'none') }}
BUILDTYPE: ${{ case(matrix.conf.debug || false, 'debug', 'debugoptimized') }}
DEBIAN_FRONTEND: noninteractive
NEEDRESTART_MODE: l
CC: ccache ${{ matrix.conf.compiler }}
FRR: ${{ matrix.conf.frr }}
DPDK: ${{ matrix.conf.dpdk }}
DPDK_CPU: generic
steps:
- name: install system dependencies
run: |
set -xe
# grout dependencies
sudo apt-get update -qy
sudo apt-get install -qy --no-install-recommends \
make gcc gdb ccache ninja-build meson git scdoc inotify-tools \
libibverbs-dev libasan8 libcmocka-dev libedit-dev libarchive-dev \
libevent-dev libmnl-dev libnuma-dev python3-pyelftools \
socat tcpdump traceroute graphviz iproute2 iputils-ping ndisc6 jq \
dnsmasq systemd-coredump abigail-tools \
"linux-modules-extra-$(uname -r)"
# FRR dependencies
sudo mkdir -p /etc/apt/keyrings
sudo curl -s -o /etc/apt/keyrings/frrouting.gpg https://deb.frrouting.org/frr/keys.gpg
echo "deb [signed-by=/etc/apt/keyrings/frrouting.gpg] https://deb.frrouting.org/frr \
$(lsb_release -s -c) frr-stable" | sudo tee /etc/apt/sources.list.d/frr.list > /dev/null
sudo apt-get update -qy
sudo apt-get install -qy --no-install-recommends \
libjson-c-dev libelf-dev libprotobuf-c-dev protobuf-c-compiler \
libreadline-dev libcap-dev librtr-dev libyang2-dev libyang2-tools
- uses: actions/checkout@v6
with:
persist-credentials: false
fetch-depth: 0 # force fetch all history
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- run: git config --global --add safe.directory $PWD
- run: git fetch --force origin 'refs/tags/v*:refs/tags/v*'
- run: echo "CCACHE_DIR=$(ccache -k cache_dir)" >> $GITHUB_ENV
- uses: actions/cache/restore@v5
id: cache
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ matrix.conf.arch || 'x86_64' }}-${{ matrix.conf.compiler }}
- run: ccache -z
- run: git rebase -x .github/workflows/check.sh "HEAD~${{ github.event.pull_request.commits }}"
if: ${{ matrix.conf.rebase && github.event.pull_request.commits }}
- run: .github/workflows/check.sh
if: ${{ ! matrix.conf.rebase || ! github.event.pull_request.commits }}
- uses: actions/upload-artifact@v7
with:
name: smoke-logs-${{ matrix.conf.arch || 'x86_64' }}-${{ matrix.conf.compiler }}-dpdk-${{ matrix.conf.dpdk }}-frr-${{ matrix.conf.frr }}
path: build/smoke/
retention-days: 10
if: always()
- run: ccache -sv
- name: delete old cache
if: ${{ ! github.event.pull_request.commits }}
uses: actions/github-script@v9
with:
script: |
try {
await github.rest.actions.deleteActionsCacheByKey({
owner: context.repo.owner,
repo: context.repo.repo,
key: "${{ steps.cache.outputs.cache-primary-key }}"
});
} catch (error) {
if (error.status !== 404) throw error;
}
- uses: actions/cache/save@v5
if: ${{ ! github.event.pull_request.commits }}
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ steps.cache.outputs.cache-primary-key }}
lint:
if: ${{ github.actor != 'grout-bot' }}
runs-on: ubuntu-24.04
container: fedora:latest
steps:
- run: dnf install -y gawk make clang-tools-extra git jq curl codespell
- uses: actions/checkout@v6
with:
persist-credentials: false
fetch-depth: 0 # force fetch all history
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- run: git config --global --add safe.directory $PWD
- run: git fetch --force origin 'refs/tags/v*:refs/tags/v*'
- run: git rebase -x ".github/workflows/check.sh lint" "HEAD~${{ github.event.pull_request.commits }}"
if: ${{ github.event.pull_request.commits }}
- run: .github/workflows/check.sh lint
if: ${{ ! github.event.pull_request.commits }}
commits:
runs-on: ubuntu-24.04
if: ${{ github.event.pull_request.commits }}
container: fedora:latest
env:
REVISION_RANGE: "HEAD~${{ github.event.pull_request.commits }}.."
steps:
- run: dnf install -y make git jq curl codespell
- uses: actions/checkout@v6
with:
persist-credentials: false
fetch-depth: 0 # force fetch all history
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- run: git config --global --add safe.directory $PWD
- run: git fetch --force origin 'refs/tags/v*:refs/tags/v*'
- run: make check-patches