Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a weekly FreeBSD CI run #2101

Merged
merged 3 commits into from
Dec 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 54 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,13 @@ jobs:
elfutils-libs
- uses: actions/checkout@v3
- name: Configure
# Set ALWAYS_ROOT because the container user is root and creating an
# unpriviledged user would be too much work.
run: |
cmake . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=/usr
-DCMAKE_INSTALL_PREFIX=/usr \
-DALWAYS_ROOT=YES
- name: Build
run: |
cmake --build build
Expand All @@ -337,6 +340,56 @@ jobs:
run: |
DESTDIR=$PWD/build/install cmake --build build --target install

freebsd:
runs-on: ubuntu-latest
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
# This has to be executed in a single step because freebsd-vm fails if run
# twice.
- name: Build, test, and install on FreeBSD
uses: vmactions/freebsd-vm@v1
with:
# qmake is required by /usr/local/lib/cmake/Qt5Core/Qt5CoreConfig.cmake
run: |
set -e
pkg install -y \
git \
cmake \
ninja \
gettext \
qt5-buildtools \
qt5-qmake \
qt5-network \
qt5-svg \
qt5-testlib \
qt5-widgets \
kf5-karchive \
lua53 \
sqlite3 \
sdl2_mixer \
readline \
zlib-ng \
libunwind \
elfutils

# Create an unpriviledged user to run tests as, otherwise the server
# refuses to start (and rightfully so)
pw user add -n action -m

# Create a script with the commands to run
cat >build-and-test.sh <<EOF
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=/usr
cmake --build build
cmake --build build --target test
DESTDIR=$PWD/build/install cmake --build build --target install
EOF

chmod +x build-and-test.sh
su action -c 'sh build-and-test.sh'

nix:
runs-on: ubuntu-latest
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
Expand Down
2 changes: 2 additions & 0 deletions server/civserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#include <cstdlib>
#ifdef FREECIV_MSWINDOWS
#include <windows.h>
#else
#include <unistd.h> // SIGHUP, SIGPIPE
#endif

// Qt
Expand Down
6 changes: 4 additions & 2 deletions utility/shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@
#include <windows.h>
#ifdef HAVE_DIRECT_H
#include <direct.h>
#endif // HAVE_DIRECT_H
#endif // FREECIV_MSWINDOWS
#endif // HAVE_DIRECT_H
#else // FREECIV_MSWINDOWS
#include <unistd.h> // getuid, geteuid
#endif // FREECIV_MSWINDOWS

// Qt
#include <QCoreApplication>
Expand Down
Loading