3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-07-26 17:02:38 +00:00
z3/.github/workflows/Windows.yml
Copilot 18b4a86740
ci: add MinGW build/test job to Windows.yml (#10211)
MinGW silently ignores `#pragma comment(lib, ...)` (MSVC-only), so
linker errors like missing `dbghelp` symbols go undetected until a
downstream user hits them. No CI coverage existed for MinGW on Windows.

## Changes

- **`.github/workflows/Windows.yml`**: New `mingw-build` job using MSYS2
UCRT64 (`mingw-w64-ucrt-x86_64-gcc`) that builds Z3 via `cmake -G Ninja`
and runs `test-z3 /a`, exercising the full link step under MinGW on
every push/PR to master.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-07-24 13:11:08 -07:00

99 lines
3.4 KiB
YAML

name: Windows
on:
push:
branches: [ master ]
pull_request:
branches: [ master]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
mingw-build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v7.0.1
- name: Setup MSYS2 (UCRT64 / MinGW-w64)
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: >-
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-cmake
mingw-w64-ucrt-x86_64-ninja
python3
- name: Build Z3 with MinGW
shell: msys2 {0}
run: |
mkdir build && cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ..
ninja -j$(nproc) shell test-z3
- name: Run unit tests
shell: msys2 {0}
run: |
cd build
./test-z3.exe /a
build:
strategy:
matrix:
arch : [x86,x64,amd64_arm64]
include:
- arch : x86
- arch : amd64_arm64
- arch : x64
cmd1 : 'julia -e "using Pkg; Pkg.add(PackageSpec(name=\"libcxxwrap_julia_jll\"))"'
cmd2 : 'julia -e "using libcxxwrap_julia_jll; print(dirname(libcxxwrap_julia_jll.libcxxwrap_julia_path))" > tmp.env'
cmd3 : 'set /P JlCxxDir=<tmp.env'
test : 1
bindings: -DJlCxx_DIR=%JlCxxDir%\..\lib\cmake\JlCxx -DZ3_BUILD_JAVA_BINDINGS=True -DZ3_BUILD_DOTNET_BINDINGS=True -DZ3_BUILD_PYTHON_BINDINGS=True
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v7.0.1
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v3
- run: |
md build
cd build
${{ matrix.cmd1 }}
${{ matrix.cmd2 }}
${{ matrix.cmd3 }}
for /f "usebackq delims=" %%i in (`"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -prerelease -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do set "VSPATH=%%i"
call "%VSPATH%\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch }} || exit /b 1
cmake ${{ matrix.bindings }} -G "NMake Makefiles" ../ || exit /b 1
nmake || exit /b 1
cd ..
shell: cmd
- name: Run Regressions
if: ${{ matrix.test }}
run: |
git clone https://github.com/z3prover/z3test z3test
python z3test\scripts\test_benchmarks.py build\z3.exe z3test\regressions\smt2
shell: cmd
- name: Run Tests
if: ${{ matrix.test }}
run: |
pushd build
for /f "usebackq delims=" %%i in (`"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -prerelease -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do set "VSPATH=%%i"
call "%VSPATH%\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch }} || exit /b 1
pushd build\python
python z3test.py z3
python z3test.py z3num
popd
pushd build
nmake cpp_example
examples\cpp_example_build_dir\cpp_example.exe
nmake c_example
examples\c_example_build_dir\c_example.exe
nmake test-z3
test-z3.exe -a
popd
shell: cmd