Skip to content

Commit 99180fb

Browse files
committed
feat: Add GitHub Actions CI workflow for multi-platform build and artifact upload.
1 parent d6b202e commit 99180fb

1 file changed

Lines changed: 12 additions & 54 deletions

File tree

.github/workflows/build.yml

Lines changed: 12 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ jobs:
2424
- os: macos-latest
2525
bin_path: build/proxpl
2626
- os: windows-latest
27-
bin_path: build/Release/proxpl.exe
28-
27+
bin_path: |
28+
build/Release/proxpl.exe
29+
build/Release/proxpl_lib.dll
30+
2931
steps:
3032
- name: Checkout source
3133
uses: actions/checkout@v4
@@ -46,55 +48,18 @@ jobs:
4648
if: matrix.os == 'windows-latest'
4749
shell: pwsh
4850
run: |
49-
# 1. Install LLVM via Chocolatey (Pinned to stable version)
5051
choco install llvm --version 17.0.6 -y --force
51-
52-
# 2. Define standard paths
5352
$llvmRoot = "C:\Program Files\LLVM"
54-
if (-not (Test-Path $llvmRoot)) {
55-
$llvmRoot = "C:\Program Files (x86)\LLVM"
56-
}
53+
if (-not (Test-Path $llvmRoot)) { $llvmRoot = "C:\Program Files (x86)\LLVM" }
5754
58-
# 3. Find LLVMConfig.cmake
5955
$llvmDir = ""
60-
$candidates = @(
61-
"$llvmRoot\lib\cmake\llvm",
62-
"$llvmRoot\share\llvm\cmake",
63-
"$llvmRoot\lib\llvm\cmake",
64-
"$llvmRoot\cmake"
65-
)
66-
56+
$candidates = @("$llvmRoot\lib\cmake\llvm", "$llvmRoot\share\llvm\cmake", "$llvmRoot\lib\llvm\cmake", "$llvmRoot\cmake")
6757
foreach ($c in $candidates) {
68-
if (Test-Path "$c") {
69-
# If the directory exists, check for config file OR accept the dir if it looks like a cmake dir
70-
if ((Test-Path "$c\LLVMConfig.cmake") -or (Test-Path "$c\LLVMConfigExtensions.cmake")) {
71-
$llvmDir = $c
72-
break
73-
}
74-
}
75-
}
76-
77-
# 4. Fallback search (more depth)
78-
if (-not $llvmDir -and (Test-Path $llvmRoot)) {
79-
Write-Host "Performing deep search in $llvmRoot..."
80-
# Try to find the directory containing LLVMConfig.cmake
81-
$found = Get-ChildItem -Path $llvmRoot -Filter "LLVMConfig.cmake" -Recurse -Depth 8 -ErrorAction SilentlyContinue | Select-Object -First 1
82-
if ($found) {
83-
$llvmDir = $found.Directory.FullName
84-
} else {
85-
# Fallback: look for LLVMConfigExtensions.cmake which we saw exists
86-
$foundExt = Get-ChildItem -Path $llvmRoot -Filter "LLVMConfigExtensions.cmake" -Recurse -Depth 8 -ErrorAction SilentlyContinue | Select-Object -First 1
87-
if ($foundExt) {
88-
$llvmDir = $foundExt.Directory.FullName
89-
Write-Host "Found likely LLVM CMake dir via Extensions: $llvmDir"
90-
}
91-
}
58+
if (Test-Path "$c\LLVMConfig.cmake") { $llvmDir = $c; break }
9259
}
9360
94-
# 5. HARDCODED FALLBACK: We know it exists here on the runner!
9561
if (-not $llvmDir -and (Test-Path "C:\Program Files\LLVM\lib\cmake\llvm")) {
9662
$llvmDir = "C:\Program Files\LLVM\lib\cmake\llvm"
97-
Write-Host "Forcing LLVM_DIR to known path: $llvmDir"
9863
}
9964
10065
if ($llvmDir) {
@@ -103,18 +68,7 @@ jobs:
10368
Add-Content $env:GITHUB_PATH "$llvmRoot/bin"
10469
Add-Content $env:GITHUB_ENV "LLVM_DIR=$llvmDir"
10570
Add-Content $env:GITHUB_ENV "LLVM_ROOT=$llvmRoot"
106-
Write-Host "SUCCESS: LLVM_DIR=$llvmDir"
107-
Write-Host "SUCCESS: LLVM_ROOT=$llvmRoot"
10871
} else {
109-
Write-Warning "LLVM not found on Windows after installation. Debug info follows:"
110-
if (Test-Path $llvmRoot) {
111-
Write-Host "Listing $llvmRoot recursively (depth 5) for debugging:"
112-
Get-ChildItem -Path $llvmRoot -Recurse -Depth 5 | Select-Object FullName
113-
} else {
114-
Write-Host "PATH $llvmRoot DOES NOT EXIST"
115-
Write-Host "Listing C:\Program Files recursively (Depth 2) to find where LLVM is:"
116-
Get-ChildItem -Path "C:\Program Files" -Recurse -Depth 2 | Select-Object FullName
117-
}
11872
exit 1
11973
}
12074
@@ -146,4 +100,8 @@ jobs:
146100
uses: actions/upload-artifact@v4
147101
with:
148102
name: ProXPL-${{ matrix.os }}
149-
path: ${{ matrix.bin_path }}
103+
# UPDATED: This will now upload the .exe and the .dll for Windows
104+
# For Linux/Mac, it still uploads the single binary.
105+
path: |
106+
${{ matrix.bin_path }}
107+
benchmarks/

0 commit comments

Comments
 (0)