Updated visuals #31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: [push, pull_request] | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
| DOCS_PATH: ${{ secrets.DOCS_PATH }} | |
| DOCS_BRANCH: ${{ secrets.DOCS_BRANCH }} | |
| # Snapshot baselines are per-platform and committed; a missing one is a gap, never a pass. | |
| ANGLESHARP_SNAPSHOT_STRICT: 1 | |
| ANGLESHARP_VERSION: 1.8.0 | |
| ANGLESHARP_CSS_VERSION: 1.1.0 | |
| jobs: | |
| can_document: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| value: ${{ steps.check_job.outputs.value }} | |
| steps: | |
| - name: Checks whether documentation can be built | |
| id: check_job | |
| run: | | |
| echo "value: ${{ env.DOCS_PATH != null && github.ref == env.DOCS_BRANCH }}" | |
| echo "::set-output name=value::${{ env.DOCS_PATH != null && github.ref == env.DOCS_BRANCH }}" | |
| documentation: | |
| needs: [can_document] | |
| runs-on: ubuntu-latest | |
| if: needs.can_document.outputs.value == 'true' | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: "20.x" | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install Dependencies | |
| run: | | |
| cd $DOCS_PATH | |
| npm install | |
| - name: Deploy Doclet | |
| run: | | |
| cd $DOCS_PATH | |
| npx pilet publish --fresh --url https://feed.piral.cloud/api/v1/pilet/anglesharp --api-key ${{ secrets.PIRAL_FEED_KEY }} | |
| # Every platform that has committed snapshot baselines has to run them. Skia rasterizes | |
| # glyphs through a different scaler per platform, so a baseline is only ever exercised by | |
| # the platform it was recorded on. The runner images are pinned on purpose: bumping one | |
| # changes the rasterization and requires regenerating the baselines via `update-snapshots`. | |
| test: | |
| name: Test (${{ matrix.name }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: linux | |
| os: ubuntu-22.04 | |
| - name: windows | |
| os: windows-2022 | |
| - name: macos | |
| os: macos-14 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup dotnet | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: | | |
| 8.0.x | |
| 10.0.x | |
| - name: Test | |
| if: runner.os != 'Windows' | |
| run: ./build.sh -Target RunUnitTests -AngleSharpVersion $ANGLESHARP_VERSION -AngleSharpCssVersion $ANGLESHARP_CSS_VERSION | |
| - name: Test | |
| if: runner.os == 'Windows' | |
| run: .\build.ps1 -Target RunUnitTests -AngleSharpVersion $env:ANGLESHARP_VERSION -AngleSharpCssVersion $env:ANGLESHARP_CSS_VERSION | |
| - name: Upload visual assets | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: visual-assets-${{ matrix.name }} | |
| path: | | |
| src/AngleSharp.Renderer.Tests/verification-assets/** | |
| src/AngleSharp.Renderer.Tests/failure-assets/** | |
| if-no-files-found: ignore | |
| # Packaging and publishing stay on Windows, but only once every platform is green. | |
| package: | |
| needs: [test] | |
| runs-on: windows-2022 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup dotnet | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: | | |
| 8.0.x | |
| 10.0.x | |
| - name: Build | |
| run: | | |
| if ($env:GITHUB_REF -eq "refs/heads/main") { | |
| .\build.ps1 -Target Publish -AngleSharpVersion $env:ANGLESHARP_VERSION -AngleSharpCssVersion $env:ANGLESHARP_CSS_VERSION | |
| } elseif ($env:GITHUB_REF -eq "refs/heads/devel") { | |
| .\build.ps1 -Target PrePublish -AngleSharpVersion $env:ANGLESHARP_VERSION -AngleSharpCssVersion $env:ANGLESHARP_CSS_VERSION | |
| } else { | |
| .\build.ps1 -AngleSharpVersion $env:ANGLESHARP_VERSION -AngleSharpCssVersion $env:ANGLESHARP_CSS_VERSION | |
| } |