From fa76daf0758b5f38c34b2ce1bcd9be64d1310a4e Mon Sep 17 00:00:00 2001 From: Johannes Schneider Date: Mon, 8 May 2023 23:13:32 +0200 Subject: [PATCH] [ci] Improve build script --- .github/workflows/build.yml | 72 ++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 67f1edb38..ab000dacc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: build_type: "debug" } - { - name: "Ubuntu Clang (Debug)", + name: "Ubuntu Clang (Release)", compiler: "clang", cc: "clang-15", cxx: "clang++-15", build_type: "release" @@ -110,7 +110,7 @@ jobs: -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \ -DINEXOR_BUILD_BENCHMARKS=ON \ -DINEXOR_BUILD_TESTS=ON \ - -DCMAKE_CXX_FLAGS="-Wall -Wextra" \ + -DCMAKE_CXX_FLAGS="-Wall \ -GNinja \ ${{ matrix.config.cmake_configure_options }} @@ -158,16 +158,36 @@ jobs: matrix: config: - { - name: "Windows MSVC", + name: "Windows MSVC (Debug)", + compiler: "msvc", + cc: "cl", cxx: "cl", + cmake_configure_options: '-G "Visual Studio 17 2022" -A x64', + build_type: "debug", + cmake_build_options: "--config Debug", + } + - { + name: "Windows MSVC (Release)", compiler: "msvc", cc: "cl", cxx: "cl", cmake_configure_options: '-G "Visual Studio 17 2022" -A x64', + build_type: "release", + cmake_build_options: "--config Release", } - { - name: "Windows Clang", + name: "Windows Clang (Debug)", compiler: "clang", cc: "clang-cl", cxx: "clang-cl", cmake_configure_options: '-G "Visual Studio 17 2022" -A x64 -T "LLVM_v143" -DCMAKE_CXX_COMPILER="clang-cl.exe" -DCMAKE_C_COMPILER="clang-cl.exe" -DCMAKE_LINKER="lld.exe"', + build_type: "debug", + cmake_build_options: "--config Debug", + } + - { + name: "Windows Clang (Release)", + compiler: "clang", + cc: "clang-cl", cxx: "clang-cl", + cmake_configure_options: '-G "Visual Studio 17 2022" -A x64 -T "LLVM_v143" -DCMAKE_CXX_COMPILER="clang-cl.exe" -DCMAKE_C_COMPILER="clang-cl.exe" -DCMAKE_LINKER="lld.exe"', + build_type: "release", + cmake_build_options: "--config Release", } steps: @@ -203,7 +223,7 @@ jobs: $env:Path += ";${{ env.INEXOR_VULKAN_SDK_PATH }}\;${{ env.INEXOR_VULKAN_SDK_PATH }}\Bin\" # TODO: Bring back Google tests and benchmarks in Windows CI cmake . ` - -Bbuild-${{ matrix.config.build_type }} ` + -Bbuild ` -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} ` -DINEXOR_BUILD_BENCHMARKS=OFF ` -DINEXOR_BUILD_TESTS=OFF ` @@ -212,39 +232,33 @@ jobs: - name: Build shell: pwsh run: | - cmake --build build-${{ matrix.config.build_type }} --config ${{ matrix.config.build_type }} + cmake --build build ${{ matrix.config.cmake_build_options }} - - name: Prepare Artifacts + - name: Prepare build artifacts shell: pwsh run: | - 7z a -tzip "${{ matrix.config.build_type }}_windows_${{ matrix.config.compiler }}.zip" ./build-${{ matrix.config.build_type }}/* - - - name: Upload Artifacts - uses: actions/upload-artifact@v3 - with: - name: ${{ matrix.config.build_type }}_windows_${{ matrix.config.compiler }}.zip - path: ${{ matrix.config.build_type }}_windows_${{ matrix.config.compiler }}.zip + 7z a -tzip "build_windows_${{ matrix.config.compiler }}.zip" ./build/* - - name: Upload Artifacts + - name: Upload build artifacts uses: actions/upload-artifact@v3 with: - name: ${{ matrix.config.build_type }}_windows_${{ matrix.config.compiler }}.zip - path: ${{ matrix.config.build_type }}_windows_${{ matrix.config.compiler }}.zip + name: build_windows_${{ matrix.config.compiler }}.zip + path: build_windows_${{ matrix.config.compiler }}.zip - - name: Prepare Artifacts + - name: Prepare release artifacts shell: pwsh run: | - mkdir artifacts - cp ./build-${{ matrix.config.build_type }}/example/${{ matrix.config.build_type }}/. artifacts - cp -r ./configuration/. artifacts - cp -r ./assets/. artifacts - mkdir -P ./artifacts/shaders - cp ./shaders/*.spv ./artifacts/shaders/ - 7z a -tzip "${{ matrix.config.build_type }}windows_amd64_${{ matrix.config.compiler }}.zip" ./artifacts/* + mkdir release + cp -r ./build/example/. release + cp -r ./configuration/. release + cp -r ./assets/. release + mkdir -P ./release/shaders + cp ./shaders/*.spv ./release/shaders/ + 7z a -tzip "release_windows_amd64_${{ matrix.config.compiler }}.zip" ./release/* - - name: Upload Artifacts + - name: Upload release artifacts uses: actions/upload-artifact@v3 with: - name: windows_amd64_${{ matrix.config.compiler }}.zip - path: windows_amd64_${{ matrix.config.compiler }}.zip - retention-days: 7 + name: release_windows_amd64_${{ matrix.config.compiler }}.zip + path: release_windows_amd64_${{ matrix.config.compiler }}.zip + retention-days: 7 \ No newline at end of file