Skip to content

Commit

Permalink
CI: Update for meson build
Browse files Browse the repository at this point in the history
We now include a Meson build that uses Clang + lld as
the build system to catch bugs and warnings that our
traditional autotools + GCC builds might miss.

We no longer build a docker image, instead we directly
execute the fvwm3-build container as a GitHub Action.
GH Actions have been factored out into a common set, and are
used as a matrix set to apply to Ubuntu (glibc) and Alpine (musl).

The Go version in fvwm3-build has been updated to enable use
with meson and eliminate the need for a complex envvar setup
and invocation, however older golang is still supported (>=1.14);
we're just relying on users to tell us if something is broken.

While the issue with LTO builds has been resolved in this PR, it was
incidental and the introduced changes will catch LTO errors before
they make it into a release.

Closes: fvwmorg#1056
Co-authored-by: Thomas Adam <[email protected]>
Signed-off-by: Matt Jolly <[email protected]>
  • Loading branch information
Kangie and ThomasAdam committed Sep 18, 2024
1 parent d153302 commit 33adf3e
Showing 1 changed file with 38 additions and 7 deletions.
45 changes: 38 additions & 7 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,44 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container:
image: ${{ matrix.os == 'alpine' && 'fvwmorg/fvwm3-build-alpine:latest' || 'fvwmorg/fvwm3-build:latest' }}
env:
GO111MODULE: "on"

strategy:
matrix:
os: [ubuntu-latest, alpine]
build-system: [autotools, meson]
compiler: [gcc, clang]

steps:
- uses: actions/checkout@v2
- name: Pulling docker image
run: docker pull fvwmorg/fvwm3-build:latest
- name: Build Package
run: 'docker build -t fvwm3 .'
- name: Checkout repository
uses: actions/checkout@v4

- name: Set git safe directory
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}

- name: Configure and Build
run: |
if [ "${{ matrix.build-system }}" = "autotools" ]; then
if [ "${{ matrix.compiler }}" = "gcc" ]; then
export CFLAGS="-flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
else
export CC_LD=lld
fi
export CC=${{ matrix.compiler }}
./autogen.sh && ./configure --enable-mandoc --enable-golang && make -j
fi
if [ "${{ matrix.build-system }}" = "meson" ]; then
if [ "${{ matrix.compiler }}" = "gcc" ]; then
export CFLAGS="-flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
else
export CC_LD=lld
fi
export CC=${{ matrix.compiler }}
meson setup builddir -Dhtmldoc=true -Dmandoc=true && ninja -C builddir
fi
notification:
runs-on: ubuntu-20.04
Expand All @@ -26,7 +57,7 @@ jobs:
uses: Gottox/[email protected]
if: github.event_name == 'pull_request'
with:
server: "irc.libera.chat"
server: irc.libera.chat
notice: false
channel: "#fvwm"
nickname: fvwm3-gh-pr
Expand All @@ -35,7 +66,7 @@ jobs:
uses: Gottox/[email protected]
if: github.event_name == 'create' && github.event.ref_type == 'tag'
with:
server: "irc.libera.chat"
server: irc.libera.chat
notice: false
channel: "#fvwm"
nickname: fvwm-gh
Expand Down

0 comments on commit 33adf3e

Please sign in to comment.