|
72 | 72 | echo "📋 Checking generated native libraries:" |
73 | 73 | find src/GrepSQL/runtimes/ -name "libpgquery_wrapper.*" -type f || echo "No native libraries found" |
74 | 74 |
|
| 75 | + - name: Install protoc on Windows |
| 76 | + if: runner.os == 'Windows' |
| 77 | + run: choco install protoc -y |
| 78 | + |
| 79 | + - name: Setup MSVC environment |
| 80 | + if: runner.os == 'Windows' |
| 81 | + uses: ilammy/msvc-dev-cmd@v1 |
| 82 | + |
75 | 83 | - name: Build for Windows |
76 | 84 | if: runner.os == 'Windows' |
77 | 85 | shell: pwsh |
|
83 | 91 | if: runner.os != 'Windows' |
84 | 92 | run: dotnet test --configuration Release --no-build --verbosity normal |
85 | 93 |
|
| 94 | + - name: Restore test project (Windows) |
| 95 | + if: runner.os == 'Windows' |
| 96 | + run: dotnet restore "tests/GrepSQL.Tests/GrepSQL.Tests.csproj" |
| 97 | + |
| 98 | + - name: Build test project (Windows) |
| 99 | + if: runner.os == 'Windows' |
| 100 | + run: dotnet build "tests/GrepSQL.Tests/GrepSQL.Tests.csproj" --configuration Release -p:Platform="Any CPU" --no-restore |
| 101 | + |
| 102 | + - name: Copy native wrapper for tests (Windows) |
| 103 | + if: runner.os == 'Windows' |
| 104 | + shell: pwsh |
| 105 | + run: | |
| 106 | + Remove-Item Env:Platform -ErrorAction SilentlyContinue |
| 107 | +
|
| 108 | + $testOut = "tests\GrepSQL.Tests\bin\Release\net9.0" |
| 109 | + New-Item -ItemType Directory -Path $testOut -Force | Out-Null |
| 110 | +
|
| 111 | + Copy-Item ` |
| 112 | + -Path "src\GrepSQL\runtimes\win-x64\native\libpgquery_wrapper.dll" ` |
| 113 | + -Destination $testOut ` |
| 114 | + -Force |
| 115 | +
|
86 | 116 | - name: Test (Windows) |
87 | 117 | if: runner.os == 'Windows' |
88 | | - run: dotnet test --configuration Release --no-build --verbosity normal |
| 118 | + shell: pwsh |
| 119 | + run: | |
| 120 | + # Unset Platform so --no-build test finds the DLL |
| 121 | + Remove-Item Env:Platform -ErrorAction SilentlyContinue |
| 122 | + dotnet test "tests/GrepSQL.Tests/GrepSQL.Tests.csproj" ` |
| 123 | + --configuration Release ` |
| 124 | + --verbosity normal |
89 | 125 |
|
90 | 126 | - name: Publish GrepSQL Binary |
91 | 127 | run: dotnet publish src/GrepSQL.CLI/GrepSQL/GrepSQL.csproj --configuration Release --runtime ${{ matrix.platform }} --self-contained true --output ./publish/${{ matrix.platform }} -p:PublishSingleFile=true -p:PublishTrimmed=true -p:IncludeNativeLibrariesForSelfExtract=true |
|
0 commit comments