Skip to content

Fixes from review: now packaging the install tree; Debian package nam… #56

Fixes from review: now packaging the install tree; Debian package nam…

Fixes from review: now packaging the install tree; Debian package nam… #56

Workflow file for this run

name: Windows
on: [push, pull_request]
jobs:
compatibility:
runs-on: windows-latest
strategy:
matrix:
VER: [v142, v143]
EXT: [ON, OFF]
GEN: [Visual Studio 17 2022]
BIN: [x64, x86]
STD: [99, 11, 17]
include:
- VER: v141
EXT: OFF
GEN: Ninja Multi-Config
BIN: x64
STD: 89 # /Za
env:
NINJA_URL: https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip
NINJA_ROOT: C:\Tools\Ninja
VS_ROOT: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise'
UseMultiToolTask: true # Better parallel MSBuild execution
steps:
- uses: actions/checkout@v3
- name: Cache Ninja install
if: matrix.GEN == 'Ninja Multi-Config'
id: ninja-install
uses: actions/cache@v2
with:
path: |
C:\Tools\Ninja
key: ${{runner.os}}-ninja-${{env.NINJA_URL}}
- name: Install Ninja
if: matrix.GEN == 'Ninja Multi-Config' && steps.ninja-install.outputs.cache-hit != 'true'
shell: pwsh
run: |
Invoke-WebRequest ${env:NINJA_URL} -OutFile ~\Downloads\ninja-win.zip
Expand-Archive ~\Downloads\ninja-win.zip -DestinationPath ${env:NINJA_ROOT}\
Remove-Item ~\Downloads\*
- name: Configure (MSBuild)
if: matrix.GEN == 'Visual Studio 17 2022'
shell: pwsh
run: |
$BIN = if('${{matrix.BIN}}' -eq 'x86') {'Win32'} else {'x64'}
$C_FLAGS = '/W4 /WX'
& cmake `
-G '${{matrix.GEN}}' `
-A $BIN `
-T ${{matrix.VER}} `
-D BUILD_TESTING=ON `
-D CMAKE_C_FLAGS="${C_FLAGS}" `
-D CMAKE_C_EXTENSIONS='${{matrix.EXT}}' `
-S "${env:GITHUB_WORKSPACE}" `
-B "${env:GITHUB_WORKSPACE}\build"
- name: Configure (Ninja Multi-Config)
if: matrix.GEN == 'Ninja Multi-Config'
shell: pwsh
run: |
$VER = switch ('${{matrix.VER}}') { `
'v141' {'14.1'} `
'v142' {'14.2'} `
'v143' {'14.3'} }
Import-Module "${env:VS_ROOT}\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
Enter-VsDevShell -VsInstallPath ${env:VS_ROOT} -SkipAutomaticLocation -DevCmdArguments "-host_arch=x64 -arch=${{matrix.BIN}} -vcvars_ver=${VER}"
$C_FLAGS = '/W4 /WX'
& cmake `
-G '${{matrix.GEN}}' `
-D CMAKE_MAKE_PROGRAM="${env:NINJA_ROOT}\ninja.exe" `
-D BUILD_TESTING=ON `
-D CMAKE_C_FLAGS="${C_FLAGS}" `
-D CMAKE_C_EXTENSIONS='${{matrix.EXT}}' `
-D CMAKE_EXE_LINKER_FLAGS='/INCREMENTAL' `
-S "${env:GITHUB_WORKSPACE}" `
-B "${env:GITHUB_WORKSPACE}\build"
- name: Build (MSBuild)
if: matrix.GEN == 'Visual Studio 17 2022'
shell: pwsh
run: |
foreach ($Config in 'Release','Debug') { `
& cmake `
--build "${env:GITHUB_WORKSPACE}\build" `
--config ${Config} `
-- `
/verbosity:minimal `
/maxCpuCount `
/noLogo
}
- name: Build (Ninja)
if: matrix.GEN == 'Ninja Multi-Config'
shell: pwsh
run: |
$VER = switch ('${{matrix.VER}}') { `
'v141' {'14.1'} `
'v142' {'14.2'} `
'v143' {'14.3'} }
Import-Module "${env:VS_ROOT}\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
Enter-VsDevShell -VsInstallPath ${env:VS_ROOT} -SkipAutomaticLocation -DevCmdArguments "-host_arch=x64 -arch=${{matrix.BIN}} -vcvars_ver=${VER}"
foreach ($Config in 'Release','Debug') { `
& cmake `
--build "${env:GITHUB_WORKSPACE}\build" `
--config ${Config} `
-- `
-j ${env:NUMBER_OF_PROCESSORS}
}
- name: Test
shell: pwsh
run: |
foreach ($Config in 'Release','Debug') { `
& ctest `
--test-dir "${env:GITHUB_WORKSPACE}\build" `
--build-config ${Config} `
--output-on-failure `
--parallel ${env:NUMBER_OF_PROCESSORS}
}
- name: Install
shell: pwsh
run: |
& cmake `
--install "${env:GITHUB_WORKSPACE}\build" `
--prefix "${env:GITHUB_WORKSPACE}\install" `
--config Release
- name: Consume (PkgConfig - bare MSBuild)
if: matrix.GEN == 'Visual Studio 17 2022'
shell: pwsh
run: |
$BIN = if('${{matrix.BIN}}' -eq 'x86') {'Win32'} else {'x64'}
$C_FLAGS = '/W4 /WX'
& cmake `
-G '${{matrix.GEN}}' `
-A $BIN `
-T ${{matrix.VER}} `
-D CMAKE_C_FLAGS="${C_FLAGS}" `
-D CMAKE_C_EXTENSIONS='${{matrix.EXT}}' `
-D CMAKE_PREFIX_PATH="${env:GITHUB_WORKSPACE}\install" `
-S "${env:GITHUB_WORKSPACE}\tests\pkgconfig\bare" `
-B "${env:GITHUB_WORKSPACE}\downstream\pkgconfig\bare"
foreach ($Config in 'Release','Debug') { `
& cmake `
--build "${env:GITHUB_WORKSPACE}\downstream\pkgconfig\bare" `
--config ${Config} `
-- `
/verbosity:minimal `
/maxCpuCount `
/noLogo `
}
- name: Consume (PkgConfig - bare Ninja)
if: matrix.GEN == 'Ninja Multi-Config'
shell: pwsh
run: |
$VER = switch ('${{matrix.VER}}') { `
'v141' {'14.1'} `
'v142' {'14.2'} `
'v143' {'14.3'} }
Import-Module "${env:VS_ROOT}\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
Enter-VsDevShell -VsInstallPath ${env:VS_ROOT} -SkipAutomaticLocation -DevCmdArguments "-host_arch=x64 -arch=${{matrix.BIN}} -vcvars_ver=${VER}"
$C_FLAGS = '/W4 /WX'
& cmake `
-G '${{matrix.GEN}}' `
-D CMAKE_MAKE_PROGRAM="${env:NINJA_ROOT}\ninja.exe" `
-D BUILD_TESTING=ON `
-D CMAKE_C_FLAGS="${C_FLAGS}" `
-D CMAKE_C_EXTENSIONS='${{matrix.EXT}}' `
-D CMAKE_EXE_LINKER_FLAGS='/INCREMENTAL' `
-D CMAKE_PREFIX_PATH="${env:GITHUB_WORKSPACE}\install" `
-S "${env:GITHUB_WORKSPACE}\tests\pkgconfig\bare" `
-B "${env:GITHUB_WORKSPACE}\downstream\pkgconfig\bare"
foreach ($Config in 'Release','Debug') { `
& cmake `
--build "${env:GITHUB_WORKSPACE}\downstream\pkgconfig\bare" `
--config ${Config} `
-- `
-j ${env:NUMBER_OF_PROCESSORS} `
}
- name: Consume (Emulate SDK presence)
shell: pwsh
run: |
New-Item -Type Directory -Path ${env:GITHUB_WORKSPACE}\install\share\cmake\OpenCL
New-Item -Type File -Path ${env:GITHUB_WORKSPACE}\install\share\cmake\OpenCL\OpenCLConfig.cmake -Value 'include("${CMAKE_CURRENT_LIST_DIR}/../OpenCLHeaders/OpenCLHeadersTargets.cmake")'
- name: Consume (PkgConfig - SDK MSBuild)
if: matrix.GEN == 'Visual Studio 17 2022'
shell: pwsh
run: |
$BIN = if('${{matrix.BIN}}' -eq 'x86') {'Win32'} else {'x64'}
$C_FLAGS = '/W4 /WX'
& cmake `
-G '${{matrix.GEN}}' `
-A $BIN `
-T ${{matrix.VER}} `
-D CMAKE_C_FLAGS="${C_FLAGS}" `
-D CMAKE_C_EXTENSIONS='${{matrix.EXT}}' `
-D CMAKE_PREFIX_PATH="${env:GITHUB_WORKSPACE}\install" `
-S "${env:GITHUB_WORKSPACE}\tests\pkgconfig\sdk" `
-B "${env:GITHUB_WORKSPACE}\downstream\pkgconfig\sdk"
foreach ($Config in 'Release','Debug') { `
& cmake `
--build "${env:GITHUB_WORKSPACE}\downstream\pkgconfig\sdk" `
--config ${Config} `
-- `
/verbosity:minimal `
/maxCpuCount `
/noLogo `
}
- name: Consume (PkgConfig - SDK Ninja)
if: matrix.GEN == 'Ninja Multi-Config'
shell: pwsh
run: |
$VER = switch ('${{matrix.VER}}') { `
'v141' {'14.1'} `
'v142' {'14.2'} `
'v143' {'14.3'} }
Import-Module "${env:VS_ROOT}\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
Enter-VsDevShell -VsInstallPath ${env:VS_ROOT} -SkipAutomaticLocation -DevCmdArguments "-host_arch=x64 -arch=${{matrix.BIN}} -vcvars_ver=${VER}"
$C_FLAGS = '/W4 /WX'
& cmake `
-G '${{matrix.GEN}}' `
-D CMAKE_MAKE_PROGRAM="${env:NINJA_ROOT}\ninja.exe" `
-D BUILD_TESTING=ON `
-D CMAKE_C_FLAGS="${C_FLAGS}" `
-D CMAKE_C_EXTENSIONS='${{matrix.EXT}}' `
-D CMAKE_EXE_LINKER_FLAGS='/INCREMENTAL' `
-D CMAKE_PREFIX_PATH="${env:GITHUB_WORKSPACE}\install" `
-S "${env:GITHUB_WORKSPACE}\tests\pkgconfig\sdk" `
-B "${env:GITHUB_WORKSPACE}\downstream\pkgconfig\sdk"
foreach ($Config in 'Release','Debug') { `
& cmake `
--build "${env:GITHUB_WORKSPACE}\downstream\pkgconfig\sdk" `
--config ${Config} `
-- `
-j ${env:NUMBER_OF_PROCESSORS} `
}