Files

136 lines
5.4 KiB
YAML

name: windows-xp
on:
push:
branches: [master]
paths:
- '.github/workflows/windows-xp.yml'
- 'toolchains/windows-xp-msvc.toolchain.cmake'
- 'toolchains/windows-xp-mingw.toolchain.cmake'
- 'toolchains/windows-xp-clang.toolchain.cmake'
- 'CMakeLists.txt'
- 'cmake/**'
- 'src/*'
- 'src/layer/*'
- 'src/layer/x86/**'
- 'tests/**'
pull_request:
branches: [master]
paths:
- '.github/workflows/windows-xp.yml'
- 'toolchains/windows-xp-msvc.toolchain.cmake'
- 'toolchains/windows-xp-mingw.toolchain.cmake'
- 'toolchains/windows-xp-clang.toolchain.cmake'
- 'CMakeLists.txt'
- 'cmake/**'
- 'src/*'
- 'src/layer/*'
- 'src/layer/x86/**'
- 'tests/**'
concurrency:
group: windows-xp-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
MSVC:
runs-on: windows-2025
env:
VS_INSTALL_DIR: C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools
UseMultiToolTask: true
NCNN_CMAKE_OPTIONS: -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON
steps:
- uses: actions/checkout@v7
with:
submodules: true
- name: config
shell: cmd
run: |
curl.exe -L -o vs_buildtools.exe https://aka.ms/vs/17/release/vs_buildtools.exe
vs_buildtools.exe --quiet --wait --norestart --nocache --installPath "${{ env.VS_INSTALL_DIR }}" --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.v141.x86.x64 --add Microsoft.VisualStudio.Component.WinXP
if %ERRORLEVEL% NEQ 0 if %ERRORLEVEL% NEQ 3010 exit /b %ERRORLEVEL%
echo === installed WinXP component ===
"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -all -products * -requires Microsoft.VisualStudio.Component.WinXP
echo === search v141_xp ===
dir /s /b "${{ env.VS_INSTALL_DIR }}\*v141_xp*"
call "${{ env.VS_INSTALL_DIR }}\VC\Auxiliary\Build\vcvarsall.bat" x86
- name: build
run: |
mkdir build; cd build
cmake ${{ env.NCNN_CMAKE_OPTIONS }} -A WIN32 -G "Visual Studio 17 2022" -T v141_xp -DNCNN_WINXP=ON -DNCNN_SIMPLEOCV=ON -DNCNN_OPENMP=OFF -DNCNN_BUILD_WITH_STATIC_CRT=ON -DNCNN_AVX=OFF -DCMAKE_TOOLCHAIN_FILE="../toolchains/windows-xp-msvc.toolchain.cmake" ..
cmake --build . --config Release -j 4
- name: test
run: cd build; ctest -C Release --output-on-failure -j 4
MinGW-w32:
runs-on: windows-2025
env:
UseMultiToolTask: true
NCNN_CMAKE_OPTIONS: -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON
steps:
- uses: actions/checkout@v7
with:
submodules: true
- name: config
run: |
Invoke-WebRequest -Uri https://github.com/nihui/ncnn-assets/releases/download/toolchain/i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z -OutFile i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z
7z x ./i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z
Add-Content -Path $env:GITHUB_ENV -Value "MINGW32_ROOT_PATH=${{ github.workspace }}\mingw32"
Add-Content -Path $env:GITHUB_PATH -Value "${{ github.workspace }}\mingw32\bin"
- name: build
run: |
mkdir build; cd build
cmake ${{ env.NCNN_CMAKE_OPTIONS }} -DCMAKE_TOOLCHAIN_FILE="../toolchains/windows-xp-mingw.toolchain.cmake" -DNCNN_WINXP=ON -DNCNN_SIMPLEOCV=ON -DNCNN_AVX=OFF .. -G "MinGW Makefiles"
cmake --build . --config Release -j 4
- name: test
run: cd build; ctest -C Release --output-on-failure -j 4
Clang:
runs-on: windows-2022
env:
UseMultiToolTask: true
NCNN_CMAKE_OPTIONS: -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON
steps:
- uses: actions/checkout@v7
with:
submodules: true
- name: Set up Clang
run: |
# Mirror of https://releases.llvm.org/6.0.0/LLVM-6.0.0-win64.exe
curl.exe -fL --retry 5 --retry-all-errors -o LLVM-6.0.0-win64.exe https://github.com/nihui/ncnn-assets/releases/download/toolchain/LLVM-6.0.0-win64.exe
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
if ((Get-FileHash LLVM-6.0.0-win64.exe -Algorithm SHA256).Hash -ne '2501887b2f638d3f65b0336f354b96f8108b563522d81e841d5c88c34af283dd') { throw 'LLVM checksum mismatch' }
7z x LLVM-6.0.0-win64.exe "-o$env:RUNNER_TEMP\llvm-6.0.0" -y
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
Add-Content -Path $env:GITHUB_PATH -Value "$env:RUNNER_TEMP\llvm-6.0.0\bin"
- name: Verify Clang
run: |
clang --version
clang++ --version
- name: config
run: |
Invoke-WebRequest -Uri https://github.com/nihui/ncnn-assets/releases/download/toolchain/i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z -OutFile i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z
7z x ./i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z
Add-Content -Path $env:GITHUB_ENV -Value "MINGW32_ROOT_PATH=${{ github.workspace }}\mingw32"
Add-Content -Path $env:GITHUB_PATH -Value "${{ github.workspace }}\mingw32\bin"
- name: build
run: |
mkdir build; cd build
cmake ${{ env.NCNN_CMAKE_OPTIONS }} -DCMAKE_TOOLCHAIN_FILE="../toolchains/windows-xp-clang.toolchain.cmake" -DNCNN_WINXP=ON -DNCNN_SIMPLEOCV=ON -DNCNN_AVX=OFF .. -G "MinGW Makefiles"
cmake --build . --config Release -j 4
- name: test
run: cd build; ctest -C Release --output-on-failure -j 4