Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 25 additions & 9 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,32 +37,47 @@ permissions:
jobs:
windows-gpu:
name: ${{ matrix.vs-version }}
runs-on: ${{ matrix.os }}
runs-on: windows-2022
strategy:
matrix:
include:
- vs-version: vs2015
toolset-version: v140
os: windows-2019

- vs-version: vs2017
toolset-version: v141
os: windows-2019

- vs-version: vs2019
toolset-version: v142
os: windows-2022

- vs-version: vs2022
toolset-version: v143
os: windows-2022

env:
UseMultiToolTask: true
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Install VS 2017 (v141) Build Tools
if: matrix.vs-version == 'vs2017'
run: |
$vsInstallPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
Start-Process -FilePath "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vs_installer.exe" -ArgumentList "modify --installPath `"$vsInstallPath`" --add Microsoft.VisualStudio.Component.VC.v141.x86.x64 --quiet --norestart --nocache" -Wait
- name: Install and Setup VS 2015 (v140) Build Tools
if: matrix.vs-version == 'vs2015'
run: |
$vs140Path = "C:/vs140_build_tools"
Invoke-WebRequest -Uri "https://aka.ms/vs/15/release/vs_buildtools.exe" -OutFile vs_buildtools.exe
Start-Process -FilePath "vs_buildtools.exe" -ArgumentList "--installPath `"$vs140Path`" --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.140 --quiet --wait --norestart --nocache" -Wait

$vcvarsPath = (Get-ChildItem -Path $vs140Path -Filter "vcvars64.bat" -Recurse | Select-Object -First 1).FullName
$cmd = "`"$vcvarsPath`" && powershell -Command `"`$env:PATH;`$env:INCLUDE;`$env:LIB`""
$output = cmd.exe /c $cmd
$lines = $output -split "`r`n"

echo "PATH=$($lines[0]);$($env:PATH)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "INCLUDE=$($lines[1])" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "LIB=$($lines[2])" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: cache-protobuf
id: cache-protobuf
uses: actions/cache@v4
Expand All @@ -75,7 +90,8 @@ jobs:
Invoke-WebRequest -Uri https://github.com/protocolbuffers/protobuf/archive/v3.11.2.zip -OutFile protobuf-3.11.2.zip
7z x ./protobuf-3.11.2.zip
cd protobuf-3.11.2
mkdir build-${{ matrix.vs-version }}; cd build-${{ matrix.vs-version }}; cmake -T ${{ matrix.toolset-version }},host=x64 -A x64 -DCMAKE_INSTALL_PREFIX="$env:GITHUB_WORKSPACE\protobuf-install" -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_MSVC_STATIC_RUNTIME=OFF -DNCNN_BUILD_TESTS=ON ../cmake
mkdir build-${{ matrix.vs-version }}; cd build-${{ matrix.vs-version }}
cmake -T ${{ matrix.toolset-version }},host=x64 -A x64 -DCMAKE_INSTALL_PREFIX="$env:GITHUB_WORKSPACE\protobuf-install" -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_MSVC_STATIC_RUNTIME=OFF -DNCNN_BUILD_TESTS=ON ../cmake
cmake --build . --config Release -j 4
cmake --build . --config Release --target install
- name: cache-swiftshader
Expand Down
Loading