Skip to content

小更新:增加了坏簇检测和丢弃功能。 #35

小更新:增加了坏簇检测和丢弃功能。

小更新:增加了坏簇检测和丢弃功能。 #35

Workflow file for this run

# This workflow builds the Filerestore_CLI project using MSBuild
name: MSBuild
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
SOLUTION_FILE_PATH: Filerestore_CLI.slnx
BUILD_CONFIGURATION: Release
BUILD_PLATFORM: x64
permissions:
contents: read
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Setup Visual Studio 2022
uses: microsoft/setup-msbuild@v2
with:
vs-version: '[17.0,18.0)'
- name: Install CMake
uses: lukka/get-cmake@latest
- name: Cache FTXUI build
id: cache-ftxui
uses: actions/cache@v4
with:
path: Filerestore_CLI/deps/ftxui/build
key: ftxui-${{ runner.os }}-${{ hashFiles('Filerestore_CLI/deps/ftxui/CMakeLists.txt') }}
restore-keys: |
ftxui-${{ runner.os }}-
- name: Clone and Build FTXUI
shell: pwsh
run: |
# Clone FTXUI
if (!(Test-Path "Filerestore_CLI/deps/ftxui")) {
Write-Host "Cloning FTXUI..."
git clone --depth 1 https://github.com/ArthurSonzogni/FTXUI.git Filerestore_CLI/deps/ftxui
}
# Build FTXUI (skip if cached)
if ("${{ steps.cache-ftxui.outputs.cache-hit }}" -ne "true") {
Write-Host "Building FTXUI..."
cd Filerestore_CLI/deps/ftxui
# Create build directory
New-Item -ItemType Directory -Force -Path build | Out-Null
cd build
# Configure with CMake
cmake .. -G "Visual Studio 17 2022" -A x64
# Build Debug
Write-Host "Building FTXUI Debug..."
cmake --build . --config Debug
# Build Release
Write-Host "Building FTXUI Release..."
cmake --build . --config Release
Write-Host "FTXUI build completed"
} else {
Write-Host "FTXUI restored from cache"
}
- name: Cache ONNX Runtime
id: cache-onnxruntime
uses: actions/cache@v4
with:
path: Filerestore_CLI/deps/onnxruntime
key: onnxruntime-${{ runner.os }}-1.16.3
restore-keys: |
onnxruntime-${{ runner.os }}-
- name: Download and Setup ONNX Runtime
if: steps.cache-onnxruntime.outputs.cache-hit != 'true'
shell: pwsh
run: |
Write-Host "Current directory: $(Get-Location)"
Write-Host "Workspace: $env:GITHUB_WORKSPACE"
# ONNX Runtime version
$version = "1.16.3"
$url = "https://github.com/microsoft/onnxruntime/releases/download/v$version/onnxruntime-win-x64-$version.zip"
$output = "onnxruntime.zip"
Write-Host "Downloading ONNX Runtime v$version from:"
Write-Host $url
try {
Invoke-WebRequest -Uri $url -OutFile $output -MaximumRetryCount 3
Write-Host "✓ Download completed, size: $((Get-Item $output).Length / 1MB) MB"
} catch {
Write-Error "Failed to download ONNX Runtime: $_"
exit 1
}
Write-Host "Extracting ONNX Runtime..."
Expand-Archive -Path $output -DestinationPath "temp_onnx" -Force
Write-Host "Contents of temp_onnx:"
Get-ChildItem -Path "temp_onnx" | ForEach-Object { Write-Host " $_" }
# Find extracted directory
$extractedDir = Get-ChildItem -Path "temp_onnx" -Directory | Select-Object -First 1
if ($null -eq $extractedDir) {
Write-Error "No directory found in extracted archive"
exit 1
}
Write-Host "Extracted directory: $($extractedDir.FullName)"
Write-Host "Contents of extracted directory:"
Get-ChildItem -Path $extractedDir.FullName | ForEach-Object { Write-Host " $_" }
# Create target directory
Write-Host "Creating target directory: Filerestore_CLI/deps"
New-Item -ItemType Directory -Force -Path "Filerestore_CLI/deps" | Out-Null
# Move and rename to onnxruntime
Write-Host "Moving to Filerestore_CLI/deps/onnxruntime..."
if (Test-Path "Filerestore_CLI/deps/onnxruntime") {
Remove-Item -Path "Filerestore_CLI/deps/onnxruntime" -Recurse -Force
}
Move-Item -Path $extractedDir.FullName -Destination "Filerestore_CLI/deps/onnxruntime" -Force
# Cleanup
Write-Host "Cleaning up temporary files..."
Remove-Item -Path $output -Force -ErrorAction SilentlyContinue
Remove-Item -Path "temp_onnx" -Recurse -Force -ErrorAction SilentlyContinue
Write-Host "ONNX Runtime setup completed"
# Verify structure
Write-Host "Verifying installation..."
Write-Host "Contents of deps/onnxruntime:"
Get-ChildItem -Path "Filerestore_CLI/deps/onnxruntime" | ForEach-Object { Write-Host " $_" }
if (Test-Path "Filerestore_CLI/deps/onnxruntime/include/onnxruntime_cxx_api.h") {
Write-Host "✓ ONNX Runtime headers found"
} else {
Write-Host "✗ ONNX Runtime headers NOT found"
Write-Host "Directory structure:"
Get-ChildItem -Path "Filerestore_CLI/deps/onnxruntime" -Recurse | Select-Object -First 20 | ForEach-Object { Write-Host " $($_.FullName)" }
exit 1
}
if (Test-Path "Filerestore_CLI/deps/onnxruntime/lib/onnxruntime.lib") {
Write-Host "✓ ONNX Runtime library found"
} else {
Write-Host "✗ ONNX Runtime library NOT found"
exit 1
}
- name: Verify ONNX Runtime (from cache)
if: steps.cache-onnxruntime.outputs.cache-hit == 'true'
shell: pwsh
run: |
Write-Host "ONNX Runtime restored from cache"
# Verify structure
if (Test-Path "Filerestore_CLI/deps/onnxruntime/include/onnxruntime_cxx_api.h") {
Write-Host "✓ ONNX Runtime headers found"
} else {
Write-Error "✗ Cache corrupted: ONNX Runtime headers NOT found"
exit 1
}
- name: Build solution
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
msbuild ${{env.SOLUTION_FILE_PATH}} `
/m `
/p:Configuration=${{env.BUILD_CONFIGURATION}} `
/p:Platform=${{env.BUILD_PLATFORM}} `
/p:PlatformToolset=v143 `
/p:WindowsTargetPlatformVersion=10.0 `
/verbosity:minimal
- name: Upload build artifacts
if: success()
uses: actions/upload-artifact@v4
with:
name: Filerestore_CLI-${{env.BUILD_PLATFORM}}-${{env.BUILD_CONFIGURATION}}
path: ${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION}}/*.exe
if-no-files-found: warn