From 2d9b35d346c068ae2a16e5bb2c8af2f90b437a5b Mon Sep 17 00:00:00 2001 From: momo5502 Date: Mon, 6 Jan 2025 13:09:55 +0100 Subject: [PATCH] Test unifying build jobs --- .github/workflows/build.yml | 160 ++++++++++-------------------------- 1 file changed, 43 insertions(+), 117 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 42e29562..eb00908c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,8 +18,6 @@ jobs: dump-registry: name: Dump Registry runs-on: windows-latest - strategy: - fail-fast: false steps: - name: Checkout Source uses: actions/checkout@v4 @@ -30,89 +28,21 @@ jobs: - name: Upload Artifacts uses: actions/upload-artifact@v4 with: - name: Registry Dump + name: Registry Dump [Temp] path: | registry/* - build-windows: - name: Build Windows - runs-on: windows-latest - strategy: - fail-fast: false - matrix: - configuration: - - Debug - - Release - include: - - configuration: Debug - preset: debug - - configuration: Release - preset: release - steps: - - name: Checkout Source - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Enable Developer Command Prompt - uses: ilammy/msvc-dev-cmd@v1.13.0 - - - name: CMake Build - run: cmake --workflow --preset=${{matrix.preset}} - - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: Windows ${{matrix.configuration}} Artifacts - path: | - build/${{matrix.preset}}/artifacts/* - - - name: Upload Test Configuration - uses: actions/upload-artifact@v4 - with: - name: Windows ${{matrix.configuration}} Test Config - path: | - build/${{matrix.preset}}/**/CTestTestfile.cmake - - build-linux-gcc: - name: Build Linux GCC - runs-on: ubuntu-24.04 - strategy: - fail-fast: false - matrix: - configuration: - - Debug - - Release - include: - - configuration: Debug - preset: debug - - configuration: Release - preset: release - steps: - - name: Checkout Source - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Install Ninja - uses: seanmiddleditch/gha-setup-ninja@v5 - - - name: CMake Build - run: cmake --workflow --preset=${{matrix.preset}} - - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: Linux GCC ${{matrix.configuration}} Artifacts - path: | - build/${{matrix.preset}}/artifacts/* - - build-linux-clang: - name: Build Linux Clang - runs-on: ubuntu-24.04 + build: + name: Build + runs-on: ${{ matrix.runner }} strategy: fail-fast: false matrix: + platform: + - Windows + - Linux GCC + - Linux Clang + - macOS configuration: - Debug - Release @@ -121,6 +51,15 @@ jobs: preset: debug - configuration: Release preset: release + - platform: Windows + runner: windows-latest + - platform: Linux GCC + runner: ubuntu-24.04 + - platform: Linux Clang + runner: ubuntu-24.04 + clang-version: 18 + - platform: macOS + runner: macos-latest steps: - name: Checkout Source uses: actions/checkout@v4 @@ -131,17 +70,22 @@ jobs: uses: seanmiddleditch/gha-setup-ninja@v5 - name: Install Clang + if: "${{ matrix.platform == 'Linux Clang' }}" run: | sudo apt update sudo apt install -y wget gnupg software-properties-common wget https://apt.llvm.org/llvm-snapshot.gpg.key -O- | sudo gpg --dearmor -o /usr/share/keyrings/llvm-archive-keyring.gpg - echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] https://apt.llvm.org/$(lsb_release -sc)/ llvm-toolchain-$(lsb_release -sc)-18 main" | sudo tee /etc/apt/sources.list.d/llvm.list + echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] https://apt.llvm.org/$(lsb_release -sc)/ llvm-toolchain-$(lsb_release -sc)-${{ matrix.clang-version }} main" | sudo tee /etc/apt/sources.list.d/llvm.list sudo apt update - sudo apt install -y clang-18 lld-18 - sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang-18 100 - sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-18 100 - sudo update-alternatives --set cc /usr/bin/clang-18 - sudo update-alternatives --set c++ /usr/bin/clang++-18 + sudo apt install -y clang-${{ matrix.clang-version }} lld-${{ matrix.clang-version }} + sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang-${{ matrix.clang-version }} 100 + sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-${{ matrix.clang-version }} 100 + sudo update-alternatives --set cc /usr/bin/clang-${{ matrix.clang-version }} + sudo update-alternatives --set c++ /usr/bin/clang++-${{ matrix.clang-version }} + + - name: Enable Developer Command Prompt + uses: ilammy/msvc-dev-cmd@v1.13.0 + if: "${{ matrix.platform == 'Windows' }}" - name: CMake Build run: cmake --workflow --preset=${{matrix.preset}} @@ -149,40 +93,22 @@ jobs: - name: Upload Artifacts uses: actions/upload-artifact@v4 with: - name: Linux Clang ${{matrix.configuration}} Artifacts + name: ${{ matrix.platform }} ${{matrix.configuration}} Artifacts path: | build/${{matrix.preset}}/artifacts/* - build-mac: - name: Build macOS - runs-on: macos-latest - strategy: - fail-fast: false - matrix: - configuration: - - Debug - - Release - include: - - configuration: Debug - preset: debug - - configuration: Release - preset: release + - name: Upload Test Configuration + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.platform }} ${{matrix.configuration}} Test Config [Temp] + path: | + build/${{matrix.preset}}/**/CTestTestfile.cmake + cleanup: + name: Cleanup Artifacts + runs-on: ubuntu-latest + needs: [dump-registry, build] + if: always() steps: - - name: Checkout Source - uses: actions/checkout@v4 + - uses: geekyeggo/delete-artifact@v5 with: - submodules: recursive - - - name: Install Dependencies - run: | - brew install ninja - - - name: CMake Build - run: cmake --workflow --preset=${{matrix.preset}} - - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: macOS ${{matrix.configuration}} Artifacts - path: | - build/${{matrix.preset}}/artifacts/* + name: '*[Temp]'