diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 7862ea23f..a5dcc1f95 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -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 @@ -26,7 +57,7 @@ jobs: uses: Gottox/irc-message-action@v2.1.3 if: github.event_name == 'pull_request' with: - server: "irc.libera.chat" + server: irc.libera.chat notice: false channel: "#fvwm" nickname: fvwm3-gh-pr @@ -35,7 +66,7 @@ jobs: uses: Gottox/irc-message-action@v2.1.3 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