Skip to content

Commit

Permalink
[ci] Improve build script
Browse files Browse the repository at this point in the history
  • Loading branch information
IAmNotHanni committed May 8, 2023
1 parent c4978c8 commit 269cd4c
Showing 1 changed file with 43 additions and 29 deletions.
72 changes: 43 additions & 29 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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 `
Expand All @@ -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

0 comments on commit 269cd4c

Please sign in to comment.