Updated CI pipeline build for Windows

dev
Tomasz Kapuściński 2023-08-13 19:51:57 +02:00
parent e807e7c984
commit 8e950e5145
3 changed files with 50 additions and 8 deletions

View File

@ -176,22 +176,19 @@ jobs:
- name: Create build directory
run: cmake -E make_directory build
- name: Run CMake (for Windows)
working-directory: build
run: cmake -G "Ninja" -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe -DVCPKG_TARGET_TRIPLET=${{ matrix.vcpkg_triplet }} -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}\scripts\buildsystems\vcpkg.cmake -DUSE_STATIC_RUNTIME=1 -DCBOT_STATIC=1 -DBOOST_STATIC=1 -DGLEW_STATIC=1 -DSNDFILE_STATIC=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\build\install -DDEV_BUILD=1 -DPORTABLE=1 -DTOOLS=1 -DTESTS=1 -DDESKTOP=1 ..
run: cmake --preset Windows-CI -DVCPKG_TARGET_TRIPLET=${{ matrix.vcpkg_triplet }} -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}\scripts\buildsystems\vcpkg.cmake
- name: Build
working-directory: build
run: |
$nproc = (Get-CIMInstance -Class 'CIM_Processor').NumberOfLogicalProcessors
cmake --build . -j $nproc
cmake --build --preset Windows-CI -j $nproc
shell: pwsh
- name: Install
working-directory: build
run: cmake --install .
run: cmake --build --preset Windows-CI --target install
- name: Upload build
uses: actions/upload-artifact@v2
with:
name: windows-msvc-debug-${{ matrix.arch }}
path: build/install
path: install
- name: Run tests
working-directory: build
run: ./colobot_ut --gtest_output=xml:gtestresults.xml

View File

@ -3,7 +3,7 @@
# Contains global options and definitions
##
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.21)
project(colobot
VERSION 0.2.1.0

45
CMakePresets.json Normal file
View File

@ -0,0 +1,45 @@
{
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 21,
"patch": 0
},
"configurePresets": [
{
"name": "CI",
"description": "Base configuration for CI pipeline",
"hidden": true,
"binaryDir": "${sourceDir}/build",
"installDir": "${sourceDir}/install"
},
{
"name": "Windows-CI",
"description": "Windows configuration for CI pipeline",
"generator": "Ninja",
"inherits": ["CI"],
"cacheVariables": {
"CMAKE_C_COMPILER": "cl.exe",
"CMAKE_CXX_COMPILER": "cl.exe",
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"USE_STATIC_RUNTIME": true,
"CBOT_STATIC": true,
"BOOST_STATIC": true,
"GLEW_STATIC": true,
"SNDFILE_STATIC": true,
"DEV_BUILD": true,
"PORTABLE": true,
"TOOLS": true,
"TESTS": true,
"DESKTOP": true
}
}
],
"buildPresets": [
{
"name": "Windows-CI",
"configurePreset": "Windows-CI",
"configuration": "RelWithDebInfo"
}
]
}