aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2025-11-27 00:07:07 +0100
committerShauren <shauren.trinity@gmail.com>2025-11-27 00:07:07 +0100
commit99a91dc21215a79cf6594aaf379315a755268f0c (patch)
treefc14956f3683766b5fde9aead1f30238a16d4a51
parent4cdc29e3f02e064b54a3599ca6ec50b6b89a3b66 (diff)
CI/GitHub: Add nopch and clang builds to linux workflow
-rw-r--r--.github/workflows/gcc-build.yml41
-rw-r--r--.github/workflows/linux-build.yml76
2 files changed, 76 insertions, 41 deletions
diff --git a/.github/workflows/gcc-build.yml b/.github/workflows/gcc-build.yml
deleted file mode 100644
index fa01c8e297e..00000000000
--- a/.github/workflows/gcc-build.yml
+++ /dev/null
@@ -1,41 +0,0 @@
-name: GCC
-
-on:
- push:
- pull_request:
-
-jobs:
- build:
- runs-on: ubuntu-22.04
- steps:
- - uses: actions/checkout@v5
- - name: Set reusable strings
- id: strings
- shell: bash
- run: |
- echo "build-output-dir=${{ github.workspace }}/bin" >> "$GITHUB_OUTPUT"
- - name: Dependencies
- run: |
- sudo apt-get update && sudo apt-get install -yq libboost-all-dev g++-11
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 --slave /usr/bin/g++ g++ /usr/bin/g++-11
- - name: Setup
- env:
- CMAKE_BUILD_TYPE: Debug
- run: >
- cmake -S ${{ github.workspace }} -B ${{ steps.strings.outputs.build-output-dir }}
- -DWITH_WARNINGS=1 -DWITH_WARNINGS_AS_ERRORS=1 -DWITH_COREDEBUG=0 -DUSE_COREPCH=1 -DUSE_SCRIPTPCH=1 -DTOOLS=1 -DSCRIPTS=dynamic -DSERVERS=1 -DNOJEM=0
- -DCMAKE_C_FLAGS_DEBUG="-DNDEBUG" -DCMAKE_CXX_FLAGS_DEBUG="-DNDEBUG"
- -DCMAKE_INSTALL_PREFIX=check_install -DBUILD_TESTING=1
- - name: Build
- run: |
- cd bin
- make -j 4 -k && make install
- - name: Unit tests
- run: |
- cd bin
- make test
- - name: Check executables
- run: |
- cd ${{ github.workspace }}/check_install/bin
- ./bnetserver --version
- ./worldserver --version
diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml
new file mode 100644
index 00000000000..15a9f960d0d
--- /dev/null
+++ b/.github/workflows/linux-build.yml
@@ -0,0 +1,76 @@
+name: Ubuntu x64
+
+on:
+ push:
+ pull_request:
+
+jobs:
+ build:
+ runs-on: ubuntu-24.04
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - cc: gcc-13
+ cxx: g++-13
+ pch: 1
+ launcher:
+ - cc: clang-17
+ cxx: clang++-17
+ pch: 1
+ launcher:
+ - cc: clang-17
+ cxx: clang++-17
+ pch: 0
+ launcher: ccache
+ steps:
+ - uses: actions/checkout@v5
+ - name: Set reusable strings
+ id: strings
+ shell: bash
+ run: |
+ echo "build-output-dir=${{ github.workspace }}/bin" >> "$GITHUB_OUTPUT"
+ echo "ccache-key-prefix=ubuntu-${{ matrix.cc }}-${{ github.base_ref || github.ref_name }}" >> "$GITHUB_OUTPUT"
+ - name: Dependencies
+ run: |
+ sudo apt-get update && sudo apt-get install -yq ccache libboost-dev libboost-filesystem-dev libboost-locale-dev libboost-program-options-dev libboost-regex-dev libboost-thread-dev libssl-dev libreadline-dev zlib1g-dev libbz2-dev
+ - name: Restore nopch cache
+ id: ccache-restore
+ if: ${{ matrix.pch == '0' }}
+ uses: actions/cache@v4
+ with:
+ path: ${{ github.workspace }}/.ccache
+ key: ${{ steps.strings.outputs.ccache-key-prefix }}-${{ github.ref_name }}-${{ github.sha }}
+ restore-keys: |
+ ${{ steps.strings.outputs.ccache-key-prefix }}-${{ github.ref_name }}-
+ ${{ steps.strings.outputs.ccache-key-prefix }}-
+ - name: Setup
+ env:
+ CMAKE_BUILD_TYPE: Debug
+ CMAKE_C_COMPILER_LAUNCHER: ${{ matrix.launcher }}
+ CMAKE_CXX_COMPILER_LAUNCHER: ${{ matrix.launcher }}
+ CC: /usr/bin/${{ matrix.cc }}
+ CXX: /usr/bin/${{ matrix.cxx }}
+ run: >
+ cmake -GNinja -S ${{ github.workspace }} -B ${{ steps.strings.outputs.build-output-dir }}
+ -DWITH_WARNINGS=1 -DWITH_WARNINGS_AS_ERRORS=1 -DWITH_COREDEBUG=0 -DUSE_COREPCH=${{ matrix.pch }} -DUSE_SCRIPTPCH=${{ matrix.pch }} -DTOOLS=1 -DSCRIPTS=dynamic -DSERVERS=1 -DNOJEM=0
+ -DCMAKE_C_FLAGS_DEBUG="-DNDEBUG -g0" -DCMAKE_CXX_FLAGS_DEBUG="-DNDEBUG -g0"
+ -DCMAKE_INSTALL_PREFIX=check_install -DBUILD_TESTING=1
+ - name: Build
+ env:
+ CCACHE_BASEDIR: ${{ github.workspace }}
+ CCACHE_DIR: ${{ github.workspace }}/.ccache
+ CCACHE_CPP2: 1
+ run: |
+ ccache -z
+ cmake --build ${{ steps.strings.outputs.build-output-dir }}
+ ccache -s
+ - name: Unit tests
+ run: |
+ cmake --build ${{ steps.strings.outputs.build-output-dir }} --target test
+ - name: Check executables
+ run: |
+ cmake --install ${{ steps.strings.outputs.build-output-dir }}
+ cd ${{ github.workspace }}/check_install/bin
+ ./bnetserver --version
+ ./worldserver --version