Skip to content

Commit 8a81dec

Browse files
mrc0mmandjrybar-rh
authored andcommitted
ci: build & run unit tests on Alpine as well
Alpine uses musl + elogind, which should provide some additional coverage, especially for issues like #539.
1 parent 9fea53d commit 8a81dec

File tree

2 files changed

+38
-4
lines changed

2 files changed

+38
-4
lines changed

.github/workflows/ci.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ set -o pipefail
66
# - drop -Wno-deprecated-declarations
77

88
PHASE="${1:?}"
9+
SESSION_TRACKING="${2:?}"
910
COMMON_BUILD_OPTS=(
1011
-Dauthfw=pam
1112
-Dexamples=true
1213
-Dgtk_doc=true
1314
-Dintrospection=true
14-
-Dsession_tracking=logind
15+
-Dsession_tracking="$SESSION_TRACKING"
1516
-Dtests=true
1617
)
1718

.github/workflows/ci.yml

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ permissions:
1414
contents: read
1515

1616
jobs:
17-
build:
17+
# glibc + systemd-logind
18+
fedora:
1819
runs-on: ubuntu-latest
1920
container:
2021
image: registry.fedoraproject.org/fedora:latest
2122
options: "--privileged"
2223
concurrency:
23-
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.phase }}
24+
group: fedora-${{ github.workflow }}-${{ github.ref }}-${{ matrix.phase }}
2425
cancel-in-progress: true
2526
strategy:
2627
fail-fast: false
@@ -36,4 +37,36 @@ jobs:
3637
dnf builddep -y polkit
3738
3839
- name: Build & test
39-
run: .github/workflows/ci.sh ${{ matrix.phase }}
40+
run: .github/workflows/ci.sh ${{ matrix.phase }} logind
41+
42+
# musl + elogind
43+
alpine:
44+
runs-on: ubuntu-latest
45+
container:
46+
image: alpine:latest
47+
options: "--privileged"
48+
concurrency:
49+
group: alpine-${{ github.workflow }}-${{ github.ref }}-${{ matrix.phase }}
50+
cancel-in-progress: true
51+
strategy:
52+
fail-fast: false
53+
matrix:
54+
# There's no libasan/libubsan on Alpine, hence the missing GCC_ASAN_UBSAN phase
55+
# See: https://gitlab.alpinelinux.org/alpine/aports/-/issues/10304
56+
# Future FIXME: add clang + sanitizers to both jobs
57+
phase: [BUILD_GCC, GCC, BUILD_CLANG, CLANG]
58+
steps:
59+
- name: Repository checkout
60+
uses: actions/checkout@v4
61+
62+
- name: Install build & test dependencies
63+
run: |
64+
apk update
65+
apk add bash gcc g++ clang meson ninja-build pkgconf glib-dev duktape-dev elogind-dev dbus-dev \
66+
expat-dev linux-pam-dev gobject-introspection-dev perl py3-dbusmock gtk-doc
67+
# Alpine's elogind package creates compatibility symlinks to act as a drop-in replacement for
68+
# systemd/systemd-logind. Remove them to test build with _pure_ elogind installation
69+
rm -f /usr/include/systemd /usr/lib/pkgconfig/libsystemd{,-logind}.pc
70+
71+
- name: Build & test
72+
run: .github/workflows/ci.sh ${{ matrix.phase }} elogind

0 commit comments

Comments
 (0)