From 7b4615f70c25dbd831f9d5ec675d5a88b45e28a9 Mon Sep 17 00:00:00 2001 From: Stefan Nikolei Date: Sun, 16 Nov 2025 09:11:25 +0100 Subject: [PATCH 1/2] Add ARM hosted runners Added macos-26 and ubuntu-2204 github runners which run on arm Use Tolerant ImageComparer We now use the tolerant Image Comparer for now. Disable Tests which need libgdiplus This disables all tests which need libgdiplus for macs with arm. The hosted runners do not have libgdiplus installed Install libgdiplus on mac Enable disabled tests on arm Try to create symlink Try without fallback path Skip on linux This was removed by mistake Remove whitespace --- .github/workflows/build-and-test.yml | 27 +++++++++++++++++-- .../Formats/Tiff/TiffDecoderTests.cs | 2 +- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index e00757cb7..3e3d6d0e2 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -77,13 +77,19 @@ jobs: sdk-preview: true runtime: -x64 codecov: false + - os: macos-26 + framework: net9.0 + sdk: 9.0.x + sdk-preview: true + runtime: -x64 + codecov: false - os: windows-latest framework: net9.0 sdk: 9.0.x sdk-preview: true runtime: -x64 codecov: false - - os: buildjet-4vcpu-ubuntu-2204-arm + - os: ubuntu-22.04-arm framework: net9.0 sdk: 9.0.x sdk-preview: true @@ -100,12 +106,17 @@ jobs: sdk: 8.0.x runtime: -x64 codecov: false + - os: macos-26 + framework: net8.0 + sdk: 8.0.x + runtime: -x64 + codecov: false - os: windows-latest framework: net8.0 sdk: 8.0.x runtime: -x64 codecov: false - - os: buildjet-4vcpu-ubuntu-2204-arm + - os: ubuntu-22.04-arm framework: net8.0 sdk: 8.0.x runtime: -x64 @@ -124,6 +135,18 @@ jobs: sudo apt-get update sudo apt-get -y install libgdiplus libgif-dev libglib2.0-dev libcairo2-dev libtiff-dev libexif-dev + - name: Install libgdi+, which is required for tests running on macos + if: ${{ contains(matrix.options.os, 'macos-26') }} + run: | + brew update + brew install mono-libgdiplus + # Create symlinks to make libgdiplus discoverable + sudo mkdir -p /usr/local/lib + sudo ln -sf $(brew --prefix)/lib/libgdiplus.dylib /usr/local/lib/libgdiplus.dylib + # Verify installation + ls -la $(brew --prefix)/lib/libgdiplus* || echo "libgdiplus not found in brew prefix" + ls -la /usr/local/lib/libgdiplus* || echo "libgdiplus not found in /usr/local/lib" + - name: Git Config shell: bash run: | diff --git a/tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs index 26dc4f587..5df730cb1 100644 --- a/tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs @@ -360,7 +360,7 @@ public class TiffDecoderTests : TiffDecoderBaseTester { using Image image = provider.GetImage(TiffDecoder.Instance); image.DebugSave(provider); - image.CompareToReferenceOutput(ImageComparer.Exact, provider); + image.CompareToReferenceOutput(ImageComparer.Tolerant(), provider); } [Theory] From 958aea050d747f1b6d5235e80eaabc425f49521c Mon Sep 17 00:00:00 2001 From: Stefan Nikolei Date: Fri, 21 Nov 2025 07:21:56 +0100 Subject: [PATCH 2/2] Use a more tolerant comparer --- tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs index 5df730cb1..13e739e4f 100644 --- a/tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs @@ -360,7 +360,9 @@ public class TiffDecoderTests : TiffDecoderBaseTester { using Image image = provider.GetImage(TiffDecoder.Instance); image.DebugSave(provider); - image.CompareToReferenceOutput(ImageComparer.Tolerant(), provider); + + // ARM reports a 0.0000% difference, so we use a tolerant comparer here. + image.CompareToReferenceOutput(ImageComparer.TolerantPercentage(0.0001F), provider); } [Theory]