diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6be63a0..6a0dd3f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -76,4 +76,40 @@ jobs: path: | pack/*.nupkg pack/_manifest/spdx_2.2/*.* + + test: + name: Test Package + needs: build + runs-on: windows-latest + strategy: + matrix: + dotnet-version: ['8.x', '9.x', '10.x'] + steps: + + - name: Setup dotnet + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ matrix.dotnet-version }} + + - name: Download Artifacts + uses: actions/download-artifact@v6 + with: + name: build-artifacts + path: artifacts + + - name: Install Package + shell: pwsh + run: | + $nupkg = Get-ChildItem -Path artifacts -Filter "*.nupkg" | Select-Object -First 1 + dotnet tool install --global --add-source artifacts DemaConsulting.WeasyprintTool + + - name: Test Weasyprint Tool + shell: pwsh + run: | + weasyprint --help + if ($LASTEXITCODE -ne 0) { + Write-Error "Weasyprint tool failed with exit code $LASTEXITCODE" + exit 1 + } + Write-Host "Weasyprint tool executed successfully" \ No newline at end of file diff --git a/AGENTS.md b/AGENTS.md index f952e9c..f5f04a2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -65,6 +65,7 @@ Before completing any task, always run these quality checks: 3. **Build Verification**: Check that workflows pass - Quality Checks job should pass - Build job should pass + - Test job should pass (validates package on Windows with .NET 8, 9, and 10) ### Testing Changes @@ -88,6 +89,7 @@ The project uses GitHub Actions workflows: - Downloads Weasyprint binaries - Generates SBOM (Software Bill of Materials) - Creates NuGet package + - Tests the package on Windows with .NET 8, 9, and 10 3. **release.yaml** - Handles releases - Creates releases with proper versioning diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f692ad3..54dd5bd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -86,7 +86,11 @@ Before submitting a pull request: 3. **Build**: Ensure the project builds successfully 4. **Testing**: Test your changes thoroughly -The CI pipeline will automatically run these checks on your pull request. +The CI pipeline will automatically run these checks on your pull request, including: + +- Quality checks (spelling and markdown linting) +- Build verification +- Package testing on Windows with .NET 8, 9, and 10 ### Commit Messages @@ -102,6 +106,7 @@ WeasyprintTool uses GitHub Actions for building. The build process: 1. Downloads the DotnetToolWrapper 2. Downloads Weasyprint binaries 3. Creates the NuGet package +4. Tests the package on Windows with .NET 8, 9, and 10 To test the build locally, you can examine the workflow files in `.github/workflows/`.