Skip to content

Commit b3a736c

Browse files
committed
CI: fix test failures in container
Following tests were failing: - test_Config.cpp - Testing writing to read-only file fails when run as root because DAC is overridden -> fixed by adding normal user and running the tests under it - test_Sound.cpp - Test tries to play sound so `pipewire` is required, which in turn requires D-Bus so run the tests through `dbus-run-session` Fixes #765
1 parent 729a2b9 commit b3a736c

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

.github/workflows/build-and-test.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,17 @@ jobs:
2525
pacman -Syy --noconfirm --disable-sandbox \
2626
git core/gcc extra/llvm extra/clang make ninja curl \
2727
extra/boost extra/cmake extra/ffmpeg extra/bullet extra/glm \
28-
extra/openal extra/sdl2 extra/qt5-base extra/freetype2
28+
extra/openal extra/sdl2 extra/qt5-base extra/freetype2 sudo
2929
- name: Checkout
3030
uses: actions/checkout@v4
3131
with:
3232
submodules: recursive
33-
- name: Make runtime directory
34-
run: mkdir -p ${XDG_RUNTIME_DIR}
33+
- name: Add user
34+
run: useradd build && mkdir build && chown -R build build
35+
- name: Create runtime dir
36+
run: mkdir ${XDG_RUNTIME_DIR} && chown build ${XDG_RUNTIME_DIR}
3537
- name: Build and test
36-
run: mkdir build && cd build && ctest -VV -S ../cmake/ctest/script_ci.ctest
38+
run: sudo -E -u build dbus-run-session bash -c "(pipewire &) && cd build && ctest -VV -S ../cmake/ctest/script_ci.ctest"
3739
fedora:
3840
name: Fedora
3941
runs-on: ubuntu-latest
@@ -45,15 +47,17 @@ jobs:
4547
dnf install -y git-core boost-devel gcc gcc-c++ clang llvm lcov curl \
4648
boost-devel cmake make ninja-build bullet-devel ffmpeg-free-devel \
4749
glm-devel openal-soft-devel SDL2-devel qt5-qtbase-devel \
48-
freetype-devel libasan
50+
freetype-devel libasan dbus-daemon
4951
- name: Checkout
5052
uses: actions/checkout@v4
5153
with:
5254
submodules: recursive
53-
- name: Make runtime directory
54-
run: mkdir -p ${XDG_RUNTIME_DIR}
55+
- name: Add user
56+
run: useradd build && mkdir build && chown -R build build
57+
- name: Create runtime dir
58+
run: mkdir ${XDG_RUNTIME_DIR} && chown build ${XDG_RUNTIME_DIR}
5559
- name: Build and test
56-
run: mkdir build && cd build && ctest -VV -S ../cmake/ctest/script_ci.ctest
60+
run: sudo -E -u build dbus-run-session bash -c "(pipewire &) && cd build && ctest -VV -S ../cmake/ctest/script_ci.ctest"
5761
ubuntu:
5862
name: Ubuntu
5963
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)