From f59bd4f9a9f412fd46642e2367fb646b653fecd2 Mon Sep 17 00:00:00 2001 From: Dennis Brakhane Date: Mon, 14 Jul 2025 14:01:27 +0200 Subject: [PATCH] github builds: on linux, compile PRs with clang as well (#1170) PR builds will be compiled with both GCC and Clang to more easily spot errors. There is still only one Linux artifact, the GCC one. build.yml and build-nightly.yml will still only use GCC. The only changes there are switching to ninja and adjusting the name of the github cache to be consitent with build-pr. Also the Windows CCache binary was updated to the latest version --- .github/workflows/build-nightly.yml | 1 + .github/workflows/build-pr.yml | 32 +++++++++++++++++++---------- .github/workflows/build.yml | 10 +++++---- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build-nightly.yml b/.github/workflows/build-nightly.yml index a58d73bdd..97586e44d 100644 --- a/.github/workflows/build-nightly.yml +++ b/.github/workflows/build-nightly.yml @@ -47,6 +47,7 @@ jobs: linux: + name: linux (gcc) runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index 507e66a59..52a1cb546 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -4,7 +4,7 @@ on: pull_request env: - CCACHE_VERSION: 4.10.2 + CCACHE_VERSION: 4.11.3 # needed because wiRenderer uses conditional include via __hasinclude CCACHE_NODIRECT: 1 @@ -20,8 +20,8 @@ jobs: uses: actions/cache/restore@v4 with: path: C:\Users\runneradmin\AppData\Local\ccache - key: win-ccache-${{ github.run_id }} - restore-keys: win-ccache- + key: ccache-win-${{ github.run_id }} + restore-keys: ccache-win- - name: Install Ccache run: | @@ -80,6 +80,17 @@ jobs: linux: runs-on: ubuntu-latest + name: linux (${{ matrix.cc }}) + strategy: + matrix: + include: + - cc: gcc + cxx: g++ + package_bins: true + - cc: clang + cxx: clang++ + package_bins: false + steps: - uses: actions/checkout@v4 @@ -88,8 +99,8 @@ jobs: uses: actions/cache/restore@v4 with: path: ~/.cache/ccache - key: ccache-${{ github.run_id }} - restore-keys: ccache- + key: ccache-${{ matrix.cc }}-${{ github.run_id }} + restore-keys: ccache-${{ matrix.cc }}- - name: Install dependencies run: | @@ -98,10 +109,8 @@ jobs: - name: Initial compile run: | - mkdir build - cd build - cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - CCACHE_NODIRECT=1 make -j$(nproc) + CC=${{ matrix.cc }} CXX=${{ matrix.cxx }} cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + make -C build -j$(nproc) - name: Generate shader dump run: | @@ -111,8 +120,7 @@ jobs: - name: Recompile with shader dump run: | - cd build - CCACHE_NODIRECT=1 make -B -j $(nproc) + make -C build -B -j$(nproc) - name: Save Ccache database id: save-ccache @@ -123,6 +131,7 @@ jobs: key: ${{ steps.restore-ccache.outputs.cache-primary-key }} - name: Move binaries + if: matrix.package_bins run: | mv build/Editor/Editor ./Editor_Linux mv Editor/config.ini ./ @@ -130,6 +139,7 @@ jobs: mv Editor/fonts ./ - name: Package Editor + if: matrix.package_bins uses: actions/upload-artifact@v4 with: name: Editor (Linux) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6855ca832..1a6c61b12 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,7 +5,8 @@ on: branches: [ master ] env: - CCACHE_VERSION: 4.10.2 + CCACHE_VERSION: 4.11.3 + # needed because wiRenderer uses conditional include via __hasinclude CCACHE_NODIRECT: 1 jobs: @@ -79,6 +80,7 @@ jobs: linux: + name: linux (gcc) runs-on: ubuntu-latest steps: @@ -89,7 +91,7 @@ jobs: uses: actions/cache/restore@v4 with: path: ~/.cache/ccache - key: ccache-${{ github.run_id }} + key: ccache-gcc-${{ github.run_id }} restore-keys: ccache- - name: Install dependencies @@ -102,7 +104,7 @@ jobs: mkdir build cd build cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - CCACHE_NODIRECT=1 make -j$(nproc) + make -j$(nproc) - name: Generate shader dump run: | cd build/WickedEngine @@ -112,7 +114,7 @@ jobs: - name: Recompile with shader dump run: | cd build - CCACHE_NODIRECT=1 make -B -j $(nproc) + make -B -j $(nproc) - name: Save Ccache database id: save-ccache