-
Notifications
You must be signed in to change notification settings - Fork 34
166 lines (160 loc) · 6.13 KB
/
main.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
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
#
# EFI Boot Guard
#
# Copyright (c) Siemens AG, 2021-2023
#
# Authors:
# Claudius Heine <[email protected]>
# Jan Kiszka <[email protected]>
#
# This work is licensed under the terms of the GNU GPL, version 2. See
# the COPYING file in the top-level directory.
#
# SPDX-License-Identifier: GPL-2.0-only
#
name: CI
on:
push:
branches-ignore:
- coverity_scan
jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
target:
- amd64
- i386
- arm64
- arm
- riscv64
- cppcheck
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install amd64 dependencies
if: ${{ matrix.target == 'amd64' || matrix.target == 'cppcheck' }}
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends \
autoconf-archive gcc-multilib gnu-efi libpci-dev check \
bats libarchive-zip-perl valgrind
- name: Install i386 dependencies
if: ${{ matrix.target == 'i386' }}
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install --no-install-recommends \
autoconf-archive gcc-multilib gnu-efi \
libpci-dev:i386 check:i386
- name: Install arm64 dependencies
if: ${{ matrix.target == 'arm64' }}
run: |
sudo dpkg --add-architecture arm64
sudo sed -i 's/^deb /deb [arch=amd64] /g' /etc/apt/sources.list
sudo sh -c "cat <<EOF > /etc/apt/sources.list.d/ports.list
deb [arch=arm64] http://ports.ubuntu.com/ jammy main restricted
deb [arch=arm64] http://ports.ubuntu.com/ jammy-updates main restricted
deb [arch=arm64] http://ports.ubuntu.com/ jammy universe
deb [arch=arm64] http://ports.ubuntu.com/ jammy-updates universe
deb [arch=arm64] http://ports.ubuntu.com/ jammy multiverse
deb [arch=arm64] http://ports.ubuntu.com/ jammy-updates multiverse
EOF"
sudo apt-get update
sudo apt-get install --no-install-recommends \
autoconf-archive gcc-aarch64-linux-gnu libc6-dev-arm64-cross \
gnu-efi:arm64 libpci-dev:arm64 check:arm64 \
qemu-user-static
- name: Install arm dependencies
if: ${{ matrix.target == 'arm' }}
run: |
sudo dpkg --add-architecture armhf
sudo sed -i 's/^deb /deb [arch=amd64] /g' /etc/apt/sources.list
sudo sh -c "cat <<EOF > /etc/apt/sources.list.d/ports.list
deb [arch=armhf] http://ports.ubuntu.com/ jammy main restricted
deb [arch=armhf] http://ports.ubuntu.com/ jammy-updates main restricted
deb [arch=armhf] http://ports.ubuntu.com/ jammy universe
deb [arch=armhf] http://ports.ubuntu.com/ jammy-updates universe
deb [arch=armhf] http://ports.ubuntu.com/ jammy multiverse
deb [arch=armhf] http://ports.ubuntu.com/ jammy-updates multiverse
EOF"
sudo apt-get update
sudo apt-get install --no-install-recommends \
autoconf-archive gcc-arm-linux-gnueabihf libc6-dev-armhf-cross \
gnu-efi:armhf libpci-dev:armhf check:armhf \
qemu-user-static
- name: Install riscv64 dependencies
if: ${{ matrix.target == 'riscv64' }}
run: |
sudo dpkg --add-architecture riscv64
sudo sed -i 's/^deb /deb [arch=amd64] /g' /etc/apt/sources.list
sudo sh -c "cat <<EOF > /etc/apt/sources.list.d/ports.list
deb [arch=riscv64] http://ports.ubuntu.com/ jammy main restricted
deb [arch=riscv64] http://ports.ubuntu.com/ jammy-updates main restricted
deb [arch=riscv64] http://ports.ubuntu.com/ jammy universe
deb [arch=riscv64] http://ports.ubuntu.com/ jammy-updates universe
deb [arch=riscv64] http://ports.ubuntu.com/ jammy multiverse
deb [arch=riscv64] http://ports.ubuntu.com/ jammy-updates multiverse
EOF"
sudo apt-get update
sudo apt-get install --no-install-recommends \
autoconf-archive gcc-riscv64-linux-gnu libc6-dev-riscv64-cross \
gnu-efi:riscv64 libpci-dev:riscv64 check:riscv64 \
qemu-user-static
- name: Install cppcheck
if: ${{ matrix.target == 'cppcheck' }}
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends cppcheck
- name: Prepare build
run: |
autoreconf -fi
mkdir -p build
- name: Build amd64
if: ${{ matrix.target == 'amd64' }}
run: |
pushd build >/dev/null
../configure
make check -j $(nproc) V=1
make check-valgrind -j $(nproc)
sudo make install
time bats --tap ../tests
popd >/dev/null
- name: Build i386
if: ${{ matrix.target == 'i386' }}
run: |
cd build
export PKG_CONFIG_DIR=
export PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig
export PKG_CONFIG_LIBDIR=/usr/lib/i386-linux-gnu
../configure --with-gnuefi-lib-dir=/usr/lib32 CFLAGS=-m32 \
host_alias=i586-linux
make check -j $(nproc) V=1
- name: Build arm64
if: ${{ matrix.target == 'arm64' }}
run: |
cd build
../configure --host=aarch64-linux-gnu \
PKG_CONFIG=/usr/bin/aarch64-linux-gnu-pkg-config
make check -j $(nproc) V=1
- name: Build arm
if: ${{ matrix.target == 'arm' }}
run: |
cd build
../configure --host=arm-linux-gnueabihf \
PKG_CONFIG=/usr/bin/arm-linux-gnueabihf-pkg-config
make check -j $(nproc) V=1
- name: Build riscv64
if: ${{ matrix.target == 'riscv64' }}
run: |
cd build
../configure --host=riscv64-linux-gnu \
PKG_CONFIG=/usr/bin/riscv64-linux-gnu-pkg-config
make check -j $(nproc) V=1
- name: Run cppcheck
if: ${{ matrix.target == 'cppcheck' }}
run: |
./configure
scripts/cppcheck.sh