Skip to content
Open
Show file tree
Hide file tree
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
337 changes: 337 additions & 0 deletions .github/workflows/Windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,337 @@
name: NeuG Test (Windows)

on:
workflow_dispatch:
release:
types:
- created
push:
paths:
- 'cmake/**'
- 'src/**'
- 'bin/**'
- 'proto/**'
- 'third_party/**'
- 'tools/python_bind/**'
- 'tools/utils/**'
- 'tests/**'
- '.github/workflows/Windows.yml'
- '.github/workflows/build-and-test-common.yml'
- 'scripts/install_deps.ps1'
- 'scripts/build_windows.bat'
- 'include/**'
- 'CMakeLists.txt'
- 'doc/source/tutorials/**'

concurrency:
group: ${{ github.repository }}-${{ github.event.number || github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
format_check:
if: |
github.event_name == 'workflow_dispatch' ||
github.event_name == 'release' ||
(github.event_name == 'push' && (github.repository != 'alibaba/neug' || github.ref == 'refs/heads/main'))
uses: ./.github/workflows/format-check.yml
with:
is_pull_request: ${{ github.event_name == 'pull_request' }}

# ============================================================
# Windows x64 Job: Build NeuG + run C++ and Python tests
# Uses GitHub-hosted windows-2022 runner with pre-installed
# MSVC 2022, vcpkg, Python, CMake, and Ninja.
# ============================================================
build_and_test_windows:
needs: format_check
if: ${{ (needs.format_check.result == 'success' || needs.format_check.result == 'skipped') && (github.event_name == 'workflow_dispatch' || github.event_name == 'release' || (github.event_name == 'push' && (github.repository != 'alibaba/neug' || github.ref == 'refs/heads/main'))) }}
runs-on: windows-2022
timeout-minutes: 120
defaults:
run:
shell: pwsh

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Setup MSVC Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r tools/python_bind/requirements.txt
python -m pip install pytest pytest-cov coverage

# vcpkg is pre-installed on GitHub-hosted Windows runners at C:\vcpkg.
# Setting VCPKG_ROOT lets CMake's vcpkg toolchain auto-install OpenSSL
# and other dependencies declared via find_package() in CMakeLists.txt.
- name: Setup vcpkg
run: |
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" >> $env:GITHUB_ENV
echo "Using vcpkg at: $env:VCPKG_INSTALLATION_ROOT"

- name: Cache vcpkg packages
uses: actions/cache@v4
with:
path: ${{ env.VCPKG_ROOT }}/installed
key: vcpkg-x64-windows-static-md-${{ hashFiles('CMakeLists.txt') }}
restore-keys: |
vcpkg-x64-windows-static-md-

- name: Configure CMake
run: |
$pythonExe = (Get-Command python).Path
$vcpkgToolchain = Join-Path $env:VCPKG_ROOT "scripts\buildsystems\vcpkg.cmake"
cmake -B build -G Ninja `
-DCMAKE_BUILD_TYPE=Release `
-DCMAKE_TOOLCHAIN_FILE="$vcpkgToolchain" `
-DVCPKG_TARGET_TRIPLET=x64-windows-static-md `
-DBUILD_PYTHON=ON `
-DBUILD_TEST=ON `
-DPython_EXECUTABLE="$pythonExe" `
-DPYTHON_EXECUTABLE="$pythonExe" `
.

- name: Build
run: |
$cpuCount = [Environment]::ProcessorCount
$jobs = [Math]::Min($cpuCount, 8)
Write-Host "Building with $jobs parallel jobs"
cmake --build build -j $jobs

# Windows has no RPATH ($ORIGIN/@loader_path); DLLs are resolved via
# the DLL search order (PATH, same-dir-first). Add the directories
# that contain libneug.dll and vcpkg-installed DLLs so that
# neug_py_bind.pyd can find all its dependencies at import time.
- name: Add DLL directories to PATH
run: |
$vcpkgBin = Join-Path $env:VCPKG_ROOT "installed\x64-windows-static-md\bin"
$buildSrc = Join-Path $env:GITHUB_WORKSPACE "build\src"
$buildPyBind = Join-Path $env:GITHUB_WORKSPACE "build\tools\python_bind"
Write-Host "Adding to PATH: $vcpkgBin, $buildSrc, $buildPyBind"
echo "$vcpkgBin" >> $env:GITHUB_PATH
echo "$buildSrc" >> $env:GITHUB_PATH
echo "$buildPyBind" >> $env:GITHUB_PATH

# neug.dll links against OpenSSL dynamically (libssl-3-x64.dll /
# libcrypto-3-x64.dll). Copy them next to neug_py_bind.pyd so the
# Windows loader finds them via the same-directory rule.
- name: Copy OpenSSL DLLs next to Python bindings
shell: pwsh
run: |
$dest = Join-Path $env:GITHUB_WORKSPACE "build\tools\python_bind"
$srcBuild = Join-Path $env:GITHUB_WORKSPACE "build\src"
$vcpkgInstalled = Join-Path $env:VCPKG_ROOT "installed"

# Search for OpenSSL DLLs across the entire vcpkg installation
# and the build tree (static triplet may not place them in bin/).
$searchDirs = @(
(Join-Path $vcpkgInstalled "x64-windows-static-md\bin"),
(Join-Path $vcpkgInstalled "x64-windows-static-md\tools"),
(Join-Path $vcpkgInstalled "x64-windows\bin"),
$srcBuild
)
foreach ($d in $searchDirs) {
if (Test-Path $d) {
Write-Host "Searching: $d"
Get-ChildItem -Path $d -Recurse -Filter "libssl*.dll" -ErrorAction SilentlyContinue | ForEach-Object { Write-Host " Found: $($_.FullName)" }
Get-ChildItem -Path $d -Recurse -Filter "libcrypto*.dll" -ErrorAction SilentlyContinue | ForEach-Object { Write-Host " Found: $($_.FullName)" }
}
}

# Copy all found OpenSSL DLLs to the destination
foreach ($d in $searchDirs) {
if (Test-Path $d) {
$ssl = Get-ChildItem -Path $d -Recurse -Filter "libssl-3-x64.dll" -ErrorAction SilentlyContinue | Select-Object -First 1
$crypto = Get-ChildItem -Path $d -Recurse -Filter "libcrypto-3-x64.dll" -ErrorAction SilentlyContinue | Select-Object -First 1
if ($ssl) { Copy-Item $ssl.FullName $dest -Force; Write-Host "Copied $($ssl.FullName) to $dest" }
if ($crypto) { Copy-Item $crypto.FullName $dest -Force; Write-Host "Copied $($crypto.FullName) to $dest" }
if ($ssl -and $crypto) { break }
}
}

Write-Host "=== All .dll files in $dest ==="
Get-ChildItem $dest -Filter "*.dll" | Format-Table FullName

# ========================================
# Phase 1: C++ Tests (ctest)
# Mirrors build-and-test-common.yml Phase 1.
# test_db_svc is skipped (BRPC not available on Windows).
# ========================================
- name: Run C++ tests
continue-on-error: true
env:
MODERN_GRAPH_DATA_DIR: ${{ github.workspace }}/example_dataset/modern_graph
COMPREHENSIVE_GRAPH_DATA_DIR: ${{ github.workspace }}/example_dataset/comprehensive_graph
FLEX_DATA_DIR: ${{ github.workspace }}/example_dataset/modern_graph
TEST_PATH: ${{ github.workspace }}/tests
TEST_RESOURCE: ${{ github.workspace }}/tests/compiler
run: |
cd build
ctest -R storage_test -V
ctest -R transaction_test -V
ctest -R csr_test -V
ctest -R edge_table_test -V
ctest -R graph_view_test -V
ctest -R graph_snapshot_store_test -V
ctest -R utils_test -V
ctest -R execution_test -V
ctest -R gopt_test -V
ctest -R test_vertex_table -V
ctest -R schema_test -V
ctest -R test_mmap_container -V
ctest -R logical_delete_test -V
ctest -R test_connection -V
ctest -R test_request -V
ctest -R sink_test -V
ctest -R test_indexer -V
ctest -R temporary_graph_test -V
ctest -R copy_temp_test -V

# ========================================
# Phase 2: Python Tests
# Mirrors build-and-test-common.yml Phase 3.
# Tests depending on bulk-loaded /tmp data are skipped
# (bulk_loader executable is not built on Windows).
# ========================================
- name: Install Python dev requirements
run: |
python -m pip install -r tools/python_bind/requirements_dev.txt

- name: Run Python DB init tests
continue-on-error: true
run: |
cd tools/python_bind
python -m pytest -sv tests/test_db_init.py --exitfirst

- name: Run Python DB connection test
continue-on-error: true
run: |
cd tools/python_bind
python -m pytest -sv tests/test_db_connection.py --exitfirst

- name: Run Python schema tests
continue-on-error: true
run: |
cd tools/python_bind
python -m pytest -sv tests/test_schema.py --exitfirst

- name: Run Python DML tests
continue-on-error: true
run: |
cd tools/python_bind
python -m pytest -sv tests/test_dml.py --exitfirst

- name: Run Python query tests
continue-on-error: true
run: |
cd tools/python_bind
python -m pytest -sv tests/test_query.py --exitfirst

- name: Run Python path tests
continue-on-error: true
run: |
cd tools/python_bind
python -m pytest -sv tests/test_path.py --exitfirst

- name: Run Python persistence tests
continue-on-error: true
run: |
cd tools/python_bind
python -m pytest -sv tests/test_persistence.py --exitfirst

- name: Run Python call string literal tests
continue-on-error: true
run: |
cd tools/python_bind
python -m pytest -sv tests/test_call_string_literal.py --exitfirst

- name: Run Python dataset tests
continue-on-error: true
run: |
cd tools/python_bind
python -m pytest -sv tests/test_dataset.py --exitfirst

- name: Run Python merge tests
continue-on-error: true
run: |
cd tools/python_bind
python -m pytest -sv tests/test_merge.py --exitfirst

- name: Run Python transaction tests
continue-on-error: true
run: |
cd tools/python_bind
python -m pytest -sv tests/test_db_transaction.py --exitfirst

- name: Run Python import/export tests
continue-on-error: true
run: |
cd tools/python_bind
python -m pytest -sv tests/test_db_import_export.py --exitfirst

- name: Run Python Data I/O documentation tests
continue-on-error: true
env:
FLEX_DATA_DIR: ${{ github.workspace }}/example_dataset/modern_graph
run: |
cd tools/python_bind
python -m pytest -sv tests/test_data_io_docs.py --exitfirst

- name: Run Python LOAD FROM sniffer tests (CSV and JSON)
continue-on-error: true
run: |
cd tools/python_bind
python -m pytest -sv tests/test_sniffer.py -k "csv or json" --exitfirst

- name: Run Python complex query tests
continue-on-error: true
run: |
cd tools/python_bind
python -m pytest -sv tests/test_db_cases.py --exitfirst

- name: Run Python list/array tests
continue-on-error: true
run: |
cd tools/python_bind
python -m pytest -sv tests/test_db_list.py --exitfirst
python -m pytest -sv tests/test_db_array.py --exitfirst

- name: Run Python concurrency tests
continue-on-error: true
run: |
cd tools/python_bind
python -m pytest -sv tests/test_db_concurrent.py --exitfirst

- name: Run Python transaction concurrent tests
continue-on-error: true
run: |
cd tools/python_bind
python -m pytest -sv tests/transaction/elle_tester_insert.py --exitfirst

- name: Run Python PyArrow related tests
continue-on-error: true
run: |
cd tools/python_bind
python -m pip install pyarrow==18.0.0
python -m pytest -sv tests/test_to_arrow.py --exitfirst
python -m pip uninstall -y pyarrow

- name: Run Python CLI tool tests
continue-on-error: true
run: |
cd tools/python_bind
python -m pytest -sv tests/test_ngcli_commands.py --exitfirst
python -m pytest -sv tests/test_ngcli_basics.py --exitfirst
Loading