Skip to content

Commit 7954737

Browse files
tintouximion
authored andcommitted
ci: Add automated ABI check job
Add automated ABI check with abigail.
1 parent 6f53f2b commit 7954737

File tree

3 files changed

+80
-1
lines changed

3 files changed

+80
-1
lines changed

.github/workflows/build-test.yml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Build Test
22

33
on: [push, pull_request]
44

5+
env:
6+
LAST_ABI_BREAK: 0f33069752fe06f6daf3d977cd09665b059494d8
7+
58
jobs:
69
build-test:
710
name: Build & Test
@@ -21,11 +24,40 @@ jobs:
2124
fail-fast: false
2225

2326
steps:
24-
- uses: actions/checkout@v4
27+
- name: Get this version
28+
uses: actions/checkout@v4
29+
30+
- name: Get version from last ABI break
31+
uses: actions/checkout@v4
32+
with:
33+
ref: ${{ env.LAST_ABI_BREAK }}
34+
path: original-version
35+
if: ${{ matrix.distro == 'debian' }}
2536

2637
- name: Create Build Environment
2738
run: podman build -t packagekit-${{ matrix.distro }} -f tests/ci/Dockerfile-${{ matrix.distro }} .
2839

2940
- name: Build & Test
3041
run: podman run -t -v `pwd`:/build packagekit-${{ matrix.distro }}
3142
./tests/ci/build-and-test.sh -Dpackaging_backend=${{ matrix.backend }}
43+
44+
check-abi:
45+
name: Check ABI
46+
runs-on: ubuntu-latest
47+
48+
steps:
49+
- name: Get this version
50+
uses: actions/checkout@v4
51+
52+
- name: Get version from last ABI break
53+
uses: actions/checkout@v4
54+
with:
55+
ref: ${{ env.LAST_ABI_BREAK }}
56+
path: original-version
57+
58+
- name: Create Build Environment
59+
run: podman build -t packagekit-debian -f tests/ci/Dockerfile-debian
60+
61+
- name: Build & Test
62+
run: podman run -t -v `pwd`:/build packagekit-debian
63+
./tests/ci/check-abi.sh -Dpackaging_backend=apt

tests/ci/Dockerfile-debian

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ RUN apt-get install -yq eatmydata build-essential
88

99
# install build dependencies
1010
RUN eatmydata apt-get install -yq --no-install-recommends \
11+
abigail-tools \
1112
appstream \
1213
bash-completion \
1314
gettext \

tests/ci/check-abi.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
if [ -d "build" ]; then
5+
rm build -rf
6+
fi
7+
set -x
8+
9+
meson setup build \
10+
-Dlocal_checkout=true \
11+
$@
12+
13+
DUMMY_DESTDIR=/tmp/install-root/
14+
rm -rf $DUMMY_DESTDIR
15+
16+
# Build & Install
17+
ninja -C build
18+
DESTDIR=$DUMMY_DESTDIR ninja -C build install
19+
20+
pushd original-version
21+
22+
if [ -d "build" ]; then
23+
rm build -rf
24+
fi
25+
26+
meson setup build \
27+
-Dlocal_checkout=true \
28+
$@
29+
30+
DUMMY_ORIG_DESTDIR=/tmp/install-root-orig
31+
rm -rf $DUMMY_ORIG_DESTDIR
32+
33+
# Build & Install
34+
ninja -C build
35+
DESTDIR=$DUMMY_ORIG_DESTDIR ninja -C build install
36+
37+
popd
38+
39+
abidiff \
40+
--headers-dir1 ${DUMMY_ORIG_DESTDIR}/usr/local/include/PackageKit/packagekit-glib2 \
41+
--headers-dir2 ${DUMMY_DESTDIR}/usr/local/include/PackageKit/packagekit-glib2 \
42+
--drop-private-types \
43+
--fail-no-debug-info \
44+
--no-added-syms \
45+
${DUMMY_ORIG_DESTDIR}/usr/local/lib/x86_64-linux-gnu/libpackagekit-glib2.so \
46+
${DUMMY_DESTDIR}/usr/local/lib/x86_64-linux-gnu/libpackagekit-glib2.so

0 commit comments

Comments
 (0)