-
Notifications
You must be signed in to change notification settings - Fork 527
115 lines (99 loc) · 3.12 KB
/
05-windows-build.yml
File metadata and controls
115 lines (99 loc) · 3.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Windows Build
on:
push:
branches: [ "main", "feat/win-compilation-merge-new" ]
paths-ignore:
- '**.md'
merge_group:
pull_request:
branches: [ "main" ]
paths-ignore:
- '**.md'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }}-${{ github.ref != 'refs/heads/main' || github.sha }}
cancel-in-progress: true
permissions:
contents: read
jobs:
# Windows build and test matrix
build-and-test-windows:
name: Build & Test (${{ matrix.platform }})
# runs-on: ${{ matrix.os }}
runs-on: windows-amd
strategy:
fail-fast: false
matrix:
include:
# - os: windows-2022
# platform: windows-2022-x64
- os: windows-2025
platform: windows-2025-x64
steps:
- name: Show env info
run: |
Get-CimInstance -ClassName Win32_Processor
where cl
& "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -all -products * -prerelease -format json
shell: powershell
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: recursive
clean: false
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: 'pyproject.toml'
- name: Set up MSVC environment
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Set up environment variables
run: |
$nproc = (Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors
echo "NPROC=$nproc" >> $env:GITHUB_ENV
echo "Using $nproc parallel jobs for builds"
shell: powershell
- name: Install dependencies
run: |
python -m pip install --upgrade pip `
pybind11==3.0 `
cmake==3.30.0 `
ninja==1.11.1 `
pytest `
scikit-build-core `
setuptools_scm
shell: powershell
- name: Build from source
run: |
cd "$env:GITHUB_WORKSPACE"
$env:CMAKE_GENERATOR = "Ninja"
$env:CMAKE_BUILD_PARALLEL_LEVEL = "1"
python -m pip install -v . `
--no-build-isolation `
--config-settings='cmake.define.BUILD_TOOLS=ON'
shell: powershell
- name: Run C++ Tests
run: |
cd "$env:GITHUB_WORKSPACE\build"
cmake --build . --target unittest --config Release --parallel $env:NPROC
shell: powershell
- name: Run Python Tests
run: |
cd "$env:GITHUB_WORKSPACE"
python -m pytest python/tests/
shell: powershell
- name: Run C++ Examples
run: |
cd "$env:GITHUB_WORKSPACE\examples\c++"
mkdir build
cd build
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release --parallel $env:NPROC
.\db-example.exe
.\core-example.exe
.\ailego-example.exe
shell: powershell