Skip to content

Update cmake-single-platform.yml #2

Update cmake-single-platform.yml

Update cmake-single-platform.yml #2

name: Windows DLL Build (CMake)
on:
workflow_dispatch:
inputs:
build_type:
description: "CMake configuration"
required: true
default: "Release"
type: choice
options:
- Release
- Debug
- RelWithDebInfo
- MinSizeRel
arch:
description: "MSVC architecture"
required: true
default: "x64"
type: choice
options:
- x64
- Win32
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
BUILD_DIR: build
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure (MSVC)
run: >
cmake -S "${{ github.workspace }}"
-B "${{ github.workspace }}\\${{ env.BUILD_DIR }}"
-G "Visual Studio 17 2022"
-A "${{ github.event.inputs.arch || 'x64' }}"
- name: Build
run: >
cmake --build "${{ github.workspace }}\\${{ env.BUILD_DIR }}"
--config "${{ github.event.inputs.build_type || 'Release' }}"
- name: Test
run: >
ctest --test-dir "${{ github.workspace }}\\${{ env.BUILD_DIR }}"
-C "${{ github.event.inputs.build_type || 'Release' }}"
--output-on-failure
- name: Upload DLL artifacts
uses: actions/upload-artifact@v4
with:
name: windows-dll-${{ github.event.inputs.arch || 'x64' }}-${{ github.event.inputs.build_type || 'Release' }}
path: |
${{ github.workspace }}\${{ env.BUILD_DIR }}\**\${{ github.event.inputs.build_type || 'Release' }}\*.dll
${{ github.workspace }}\${{ env.BUILD_DIR }}\**\${{ github.event.inputs.build_type || 'Release' }}\*.lib
${{ github.workspace }}\${{ env.BUILD_DIR }}\**\${{ github.event.inputs.build_type || 'Release' }}\*.pdb
if-no-files-found: error