mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-10-10 22:24:14 -04:00
ci(release): pin Poppler for Windows PDF verification
This commit is contained in:
1 parent
3ddfff242d
commit
028adee046
4 files changed
+21
-10
No files matched your search
@@ -49,6 +49,20 @@ jobs:
|
||||
run: |
|
||||
dotnet build OpenNest.sln -c Release
|
||||
if ($LASTEXITCODE -ne 0) { throw 'Solution build failed.' }
|
||||
- name: Install pinned Poppler for PDF report tests
|
||||
run: |
|
||||
$zip = Join-Path $env:RUNNER_TEMP 'poppler-26.09.0.zip'
|
||||
Invoke-WebRequest 'https://github.com/oschwartz10612/poppler-windows/releases/download/v26.09.0-0/Release-26.09.0-0.zip' -OutFile $zip
|
||||
$actual = (Get-FileHash $zip -Algorithm SHA256).Hash.ToLowerInvariant()
|
||||
if ($actual -ne '7a6f256a0ddf7536182246a5733331bf4677cbcc34f4663774947ad34556c8d0') { throw 'Poppler archive hash mismatch.' }
|
||||
$destination = Join-Path $env:RUNNER_TEMP 'poppler-release-tests'
|
||||
Expand-Archive $zip -DestinationPath $destination
|
||||
$bin = Join-Path $destination 'poppler-26.09.0/Library/bin'
|
||||
$tool = Join-Path $bin 'pdftotext.exe'
|
||||
if (-not (Test-Path $tool)) { throw 'Pinned pdftotext.exe is missing.' }
|
||||
& $tool -v
|
||||
if ($LASTEXITCODE -ne 0) { throw 'Pinned pdftotext.exe cannot start.' }
|
||||
$bin >> $env:GITHUB_PATH
|
||||
- name: Run all test projects on Windows
|
||||
# A test silent for 5 minutes is killed and named in the log, with a
|
||||
# mini dump in TestResults, instead of holding the runner until the
|
||||
|
||||
@@ -37,15 +37,7 @@ public sealed class NestPdfWriterTests : IDisposable
|
||||
public void Write_PdfTextCarriesDocumentLocalIdsQuantitiesAndPageNumbers()
|
||||
{
|
||||
var path = WriteReport(NestReportTestData.CreateNest());
|
||||
if (OperatingSystem.IsWindows() && Environment.GetEnvironmentVariable("GITHUB_ACTIONS") == "true")
|
||||
{
|
||||
var results = Path.Combine(Environment.GetEnvironmentVariable("GITHUB_WORKSPACE")!, "TestResults");
|
||||
Directory.CreateDirectory(results);
|
||||
File.Copy(path, Path.Combine(results, "pdf-report-text-diagnostic.pdf"), overwrite: true);
|
||||
}
|
||||
var summary = ReportPdf.Text(path, 1);
|
||||
if (OperatingSystem.IsWindows() && Environment.GetEnvironmentVariable("GITHUB_ACTIONS") == "true")
|
||||
File.WriteAllText(Path.Combine(Environment.GetEnvironmentVariable("GITHUB_WORKSPACE")!, "TestResults", "pdf-report-text-windows.txt"), summary);
|
||||
var plate = ReportPdf.Text(path, 2);
|
||||
|
||||
Assert.Contains("Report test job", summary);
|
||||
|
||||
@@ -133,7 +133,10 @@ dotnet test OpenNest.Tests/OpenNest.Tests.csproj --filter FullyQualifiedName~Rep
|
||||
The writer tests read page sizes and content streams with PDFsharp. Text
|
||||
assertions use Poppler's `pdftotext -bbox` coordinates to rebuild visual rows;
|
||||
`-layout` can return columns in a different order on Windows. They are skipped,
|
||||
not passed, when poppler-utils is absent. For manual inspection also use `pdfinfo`,
|
||||
not passed, when poppler-utils is absent. The Windows release workflow installs
|
||||
an SHA-256-pinned Poppler binary because the runner's built-in `pdftotext` lacks
|
||||
`-bbox`; no PDF text test is skipped for that reason in a release candidate.
|
||||
For manual inspection also use `pdfinfo`,
|
||||
`pdffonts` and `pdftoppm -png` (Linux verification baseline: poppler-utils
|
||||
24.02.0). Confirm page sizes, quantity rows, page X of Y, embedded fonts, native
|
||||
vector curves, unfilled holes and visible tab gaps with no connecting stroke.
|
||||
|
||||
+3
-1
@@ -15,7 +15,9 @@ pulls from GitHub every hour; it refuses pushes.
|
||||
runner. It builds the solution, runs all six test projects in Release and
|
||||
the main test project in Debug, then packages and smoke-tests the desktop app.
|
||||
A test that is silent for five minutes is killed and named in the log, with a
|
||||
mini dump in the uploaded `windows-test-results` artifact.
|
||||
mini dump in the uploaded `windows-test-results` artifact. The release job
|
||||
installs a SHA-256-pinned Poppler Windows binary for PDF text/column tests;
|
||||
the runner's older `pdftotext` lacks the required `-bbox` option.
|
||||
Optional local/proprietary fixture and opt-in measurement tests may skip;
|
||||
inspect the uploaded TRX files rather than treating skips as passes.
|
||||
4. Download the `OpenNest-X.Y.Z-win-x64` artifact and verify its `.sha256`.
|
||||
|
||||
Reference in new issue
Block a user