-
Notifications
You must be signed in to change notification settings - Fork 6
167 lines (160 loc) · 5.08 KB
/
ci.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
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
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2023 Robin Jarry
---
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-24.04
env:
SANITIZE: address
BUILDTYPE: debugoptimized
MESON_EXTRA_OPTS: "-Ddpdk:platform=generic"
DEBIAN_FRONTEND: noninteractive
NEEDRESTART_MODE: l
CC: gcc-14
steps:
- name: install system dependencies
run: |
set -xe
sudo apt-get update -qy
sudo apt-get install -qy --no-install-recommends \
make gcc ninja-build meson git scdoc libibverbs-dev \
libasan8 libcmocka-dev libedit-dev libarchive-dev \
libevent-dev libsmartcols-dev libnuma-dev python3-pyelftools
- uses: actions/checkout@v4
- run: make
- uses: actions/upload-artifact@v4
with:
name: debug-binaries
path: |
build/grout
build/grcli
retention-days: 5
- run: make unit-tests
smoke:
runs-on: ubuntu-24.04
needs: build
env:
DEBIAN_FRONTEND: noninteractive
NEEDRESTART_MODE: l
steps:
- name: install system dependencies
run: |
set -xe
sudo apt-get update -qy
sudo NEEDRESTART_MODE=l apt-get install -qy --no-install-recommends \
git socat tcpdump traceroute \
iproute2 iputils-ping libasan8 libedit2 \
libevent-2.1-7t64 libsmartcols1 libnuma1
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: debug-binaries
path: build
merge-multiple: true
- run: chmod -c a+x build/gr*
- run: sudo smoke/run.sh build
lint:
runs-on: ubuntu-latest
container: fedora:latest
env:
REVISION_RANGE: "${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}"
steps:
- run: dnf install -y make clang-tools-extra git jq curl
- uses: actions/checkout@v4
with:
fetch-depth: 0 # force fetch all history
- run: git config --global --add safe.directory $PWD
- run: make lint
- run: make check-patches
if: ${{ github.event.pull_request.base.sha && github.event.pull_request.head.sha }}
deb:
runs-on: ubuntu-latest
container: "debian:stable"
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- name: install system dependencies
run: |
set -xe
apt-get update -qy
NEEDRESTART_MODE=l apt-get install -qy --no-install-recommends \
git build-essential meson ninja-build pkgconf scdoc python3-pyelftools \
libcmocka-dev libedit-dev libevent-dev libnuma-dev \
libsmartcols-dev libarchive-dev libibverbs-dev \
bash-completion devscripts debhelper
- uses: actions/checkout@v4
with:
fetch-depth: 0 # force fetch all history
- run: git config --global --add safe.directory $PWD
- run: make deb
- uses: actions/upload-artifact@v4
with:
name: deb-packages
path: grout*.deb
retention-days: 5
rpm:
runs-on: ubuntu-latest
container: "quay.io/centos/centos:stream9"
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- name: install system dependencies
run: |
set -xe
dnf --enablerepo=crb install -y --nodocs --setopt=install_weak_deps=0 \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
dnf --enablerepo=crb install -y --nodocs --setopt=install_weak_deps=0 \
gcc git make meson ninja-build pkgconf scdoc python3-pyelftools \
libcmocka-devel libedit-devel libevent-devel numactl-devel \
libsmartcols-devel libarchive-devel rdma-core-devel \
rpm-build systemd
- uses: actions/checkout@v4
with:
fetch-depth: 0 # force fetch all history
- run: git config --global --add safe.directory $PWD
- run: make rpm
- uses: actions/upload-artifact@v4
with:
name: rpm-packages
path: grout*.rpm
retention-days: 5
publish:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
needs:
- deb
- rpm
- smoke
- lint
permissions: write-all
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: "*-packages"
merge-multiple: true
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- uses: docker/build-push-action@v6
with:
context: .
file: Containerfile
tags: "ghcr.io/dpdk/grout:edge"
push: true
- uses: pyTooling/Actions/releaser@r0
with:
token: ${{ github.token }}
tag: "edge"
files: |
grout.x86_64.rpm
grout-debuginfo.x86_64.rpm
grout-debugsource.x86_64.rpm
grout_amd64.deb
grout-dbgsym_amd64.deb