-
Notifications
You must be signed in to change notification settings - Fork 31
118 lines (116 loc) · 3.54 KB
/
ci.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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
checks: write
pull-requests: write
jobs:
prepare:
strategy:
matrix:
arch: [ 'X64', 'ARM64' ]
container: 'fedora:38'
runs-on: [self-hosted, "${{ matrix.arch }}"]
steps:
- name: Install packages Fedora
if: matrix.image == 'fedora:38'
run: |
sudo dnf -y install 'dnf-command(copr)'
sudo dnf --setopt=cachedir=${GITHUB_WORKSPACE}/cache --setopt=keepcache=True --setopt=install_weak_deps=False -y install \
clang-tools-extra \
cmake \
libcmocka-devel \
doxygen \
lcov \
libasan \
libbpf-devel \
libubsan \
python3-breathe \
python3-furo \
python3-sphinx \
pkgconf
- name: Cache node modules
uses: actions/cache@v3
with:
path: ${GITHUB_WORKSPACE}/cache
key: ${{ matrix.arch }}
build:
strategy:
fail-fast: false
matrix:
buildtype: [ 'debug', 'release' ]
image: [ 'fedora:38', 'ubuntu:23.10' ]
arch: [ 'X64', 'ARM64' ]
container: ${{ matrix.image }}
runs-on: [self-hosted, "${{ matrix.arch }}"]
needs: [prepare]
steps:
- name: Cache node modules
uses: actions/cache@v3
if: matrix.image == 'fedora:38'
with:
path: ${GITHUB_WORKSPACE}/cache
key: ${{ matrix.arch }}
- name: Install packages Fedora
if: matrix.image == 'fedora:38'
run: |
sudo dnf -y install 'dnf-command(copr)'
sudo dnf --setopt=cachedir=${GITHUB_WORKSPACE}/cache --setopt=keepcache=True --setopt=install_weak_deps=False -y install \
clang-tools-extra \
cmake \
libcmocka-devel \
doxygen \
lcov \
libasan \
libbpf-devel \
libubsan \
python3-breathe \
python3-furo \
python3-sphinx \
pkgconf
- name: Install packages Ubuntu
if: matrix.image == 'ubuntu:23.10'
run: |
apt-get update
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install \
clang-format \
clang-tidy \
cmake \
doxygen \
furo \
lcov \
libbpf-dev \
libcmocka-dev \
python3-breathe \
python3-pip \
python3-sphinx \
pkgconf
- name: Check out repository code
uses: actions/checkout@v4
- name: Configure build
run: cmake -B $GITHUB_WORKSPACE/build -S $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.buildtype }}
- name: Build
run: make -C $GITHUB_WORKSPACE/build
- name: Check style
if: matrix.buildtype == 'release'
run: make -C $GITHUB_WORKSPACE/build checkstyle
- name: Run unit tests
run: make -C $GITHUB_WORKSPACE/build test
- name: Coverage
if: matrix.buildtype == 'Debug' && matrix.image == 'fedora:38'
run: make -C $GITHUB_WORKSPACE/build coverage
- name: Upload coverage report to Codecov
if: matrix.buildtype == 'Debug' && matrix.image == 'fedora:38'
uses: codecov/codecov-action@v3
with:
files: build/doc/lcov.out
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Generate documentation
if: matrix.buildtype == 'release'
run: make -C $GITHUB_WORKSPACE/build doc