From 6d895ad41a035d9d934bdcdf2121d4d364f92836 Mon Sep 17 00:00:00 2001 From: Shane32 Date: Tue, 2 Apr 2024 10:07:09 -0400 Subject: [PATCH 1/2] Fix tests locally --- QRCoderTests/ArtQRCodeRendererTests.cs | 20 ------------------ QRCoderTests/PngByteQRCodeRendererTests.cs | 4 ---- QRCoderTests/QRCodeRendererTests.cs | 24 ---------------------- 3 files changed, 48 deletions(-) diff --git a/QRCoderTests/ArtQRCodeRendererTests.cs b/QRCoderTests/ArtQRCodeRendererTests.cs index bcd32c9f..6657a7f4 100644 --- a/QRCoderTests/ArtQRCodeRendererTests.cs +++ b/QRCoderTests/ArtQRCodeRendererTests.cs @@ -23,11 +23,7 @@ public void can_create_standard_qrcode_graphic() var bmp = new ArtQRCode(data).GetGraphic(10); var result = HelperFunctions.BitmapToHash(bmp); -#if NET35_OR_GREATER || NET40_OR_GREATER - result.ShouldBe("11ebdda91b9632d016798cb6de2f5339"); -#else result.ShouldBe("cb38c3156eaf13cdfba699bdafc3a84c"); -#endif } [Fact] @@ -40,11 +36,7 @@ public void can_create_standard_qrcode_graphic_with_custom_finder() var bmp = new ArtQRCode(data).GetGraphic(10, Color.Black, Color.White, Color.Transparent, finderPatternImage: finder); var result = HelperFunctions.BitmapToHash(bmp); -#if NET35_OR_GREATER || NET40_OR_GREATER - result.ShouldBe("c54a7389ae995abc838f0d228acc3bad"); -#else result.ShouldBe("1102c0c6f235eaf4c3ac639f82f17bfa"); -#endif } [Fact] @@ -56,11 +48,7 @@ public void can_create_standard_qrcode_graphic_without_quietzone() var bmp = new ArtQRCode(data).GetGraphic(10, Color.Black, Color.White, Color.Transparent, drawQuietZones: false); var result = HelperFunctions.BitmapToHash(bmp); -#if NET35_OR_GREATER || NET40_OR_GREATER - result.ShouldBe("550f31b988ff12d5f8429ef19d9d5a0c"); -#else result.ShouldBe("632315c8695416fc82fe06a202688433"); -#endif } [Fact] @@ -74,11 +62,7 @@ public void can_create_standard_qrcode_graphic_with_background() var result = HelperFunctions.BitmapToHash(bmp); -#if NET35_OR_GREATER || NET40_OR_GREATER - result.ShouldBe("2caa9c0ee8fcb4a93841debb58cf41bc"); -#else result.ShouldBe("bbea08507282773175cfe7b52f0ddae4"); -#endif } [Fact] @@ -112,11 +96,7 @@ public void can_render_artqrcode_from_helper() var bmp = ArtQRCodeHelper.GetQRCode("A", 10, Color.Black, Color.White, Color.Transparent, QRCodeGenerator.ECCLevel.L); var result = HelperFunctions.BitmapToHash(bmp); -#if NET35_OR_GREATER || NET40_OR_GREATER - result.ShouldBe("fea51114bc4ff893542a1c0574c82a07"); -#else result.ShouldBe("57ecaa9bdeadcdcbeac8a19d734907ff"); -#endif } } } diff --git a/QRCoderTests/PngByteQRCodeRendererTests.cs b/QRCoderTests/PngByteQRCodeRendererTests.cs index 7be21684..0bba6e82 100644 --- a/QRCoderTests/PngByteQRCodeRendererTests.cs +++ b/QRCoderTests/PngByteQRCodeRendererTests.cs @@ -107,11 +107,7 @@ public void can_render_pngbyte_qrcode_color_without_quietzones() var bmp = (Bitmap)Image.FromStream(mStream); bmp.MakeTransparent(Color.Transparent); var result = HelperFunctions.BitmapToHash(bmp); -#if NET35_OR_GREATER || NET40_OR_GREATER - result.ShouldBe("75be11d582575617d2490c54b69e844e"); -#else result.ShouldBe("fbbc8255ebf3e4f4a1d21f0dd15f76f8"); -#endif } #endif } diff --git a/QRCoderTests/QRCodeRendererTests.cs b/QRCoderTests/QRCodeRendererTests.cs index b7414e2b..ed77ec5f 100644 --- a/QRCoderTests/QRCodeRendererTests.cs +++ b/QRCoderTests/QRCodeRendererTests.cs @@ -46,11 +46,7 @@ public void can_create_qrcode_standard_graphic_without_quietzones() var bmp = new QRCode(data).GetGraphic(5, Color.Black, Color.White, false); var result = HelperFunctions.BitmapToHash(bmp); -#if NET35_OR_GREATER || NET40_OR_GREATER - result.ShouldBe("329e1664f57cbe7332d8d4db04c1d480"); -#else result.ShouldBe("d703e54a0ba541c6ea69e3d316e394e7"); -#endif } @@ -65,11 +61,7 @@ public void can_create_qrcode_with_transparent_logo_graphic() var bmp = new QRCode(data).GetGraphic(10, Color.Black, Color.Transparent, icon: (Bitmap)Image.FromFile(HelperFunctions.GetAssemblyPath() + "\\assets\\noun_software engineer_2909346.png")); //Used logo is licensed under public domain. Ref.: https://thenounproject.com/Iconathon1/collection/redefining-women/?i=2909346 var result = HelperFunctions.BitmapToHash(bmp); -#if NET35_OR_GREATER || NET40_OR_GREATER - result.ShouldBe("ee65d96c3013f6032b561cc768251eef"); -#else result.ShouldBe("150f8fc7dae4487ba2887d2b2bea1c25"); -#endif } [Fact] @@ -83,11 +75,7 @@ public void can_create_qrcode_with_non_transparent_logo_graphic() //Used logo is licensed under public domain. Ref.: https://thenounproject.com/Iconathon1/collection/redefining-women/?i=2909346 var result = HelperFunctions.BitmapToHash(bmp); -#if NET35_OR_GREATER || NET40_OR_GREATER - result.ShouldBe("1d718f06f904af4a46748f02af2d4eec"); -#else result.ShouldBe("c46a7ec51bf978d7a882059c322ca69d"); -#endif } [Fact] @@ -102,11 +90,7 @@ public void can_create_qrcode_with_logo_and_with_transparent_border() var bmp = new QRCode(data).GetGraphic(10, Color.Black, Color.Transparent, icon: logo, iconBorderWidth: 6); //Used logo is licensed under public domain. Ref.: https://thenounproject.com/Iconathon1/collection/redefining-women/?i=2909346 var result = HelperFunctions.BitmapToHash(bmp); -#if NET35_OR_GREATER || NET40_OR_GREATER - result.ShouldBe("ee65d96c3013f6032b561cc768251eef"); -#else result.ShouldBe("150f8fc7dae4487ba2887d2b2bea1c25"); -#endif } [Fact] @@ -121,11 +105,7 @@ public void can_create_qrcode_with_logo_and_with_standard_border() var bmp = new QRCode(data).GetGraphic(10, Color.Black, Color.White, icon: logo, iconBorderWidth: 6); //Used logo is licensed under public domain. Ref.: https://thenounproject.com/Iconathon1/collection/redefining-women/?i=2909346 var result = HelperFunctions.BitmapToHash(bmp); -#if NET35_OR_GREATER || NET40_OR_GREATER - result.ShouldBe("52207bd86ca5a532fb2095dbaa0ae04c"); -#else result.ShouldBe("1c926ea1d48f42fdf8e6f1438b774cdd"); -#endif } [Fact] @@ -140,11 +120,7 @@ public void can_create_qrcode_with_logo_and_with_custom_border() var bmp = new QRCode(data).GetGraphic(10, Color.Black, Color.Transparent, icon: logo, iconBorderWidth: 6, iconBackgroundColor: Color.DarkGreen); //Used logo is licensed under public domain. Ref.: https://thenounproject.com/Iconathon1/collection/redefining-women/?i=2909346 var result = HelperFunctions.BitmapToHash(bmp); -#if NET35_OR_GREATER || NET40_OR_GREATER - result.ShouldBe("d2f20d34a973d92b9c3e05db1393b331"); -#else result.ShouldBe("9a06bfbb72df999b6290b5af5c4037cb"); -#endif } From ac03f1ea1e86c841b477d60c21496cb709cae6c6 Mon Sep 17 00:00:00 2001 From: Shane32 Date: Tue, 2 Apr 2024 10:11:53 -0400 Subject: [PATCH 2/2] Bump workflow versions --- .github/workflows/wf-build-release-ci.yml | 18 +++++++++--------- .github/workflows/wf-build-release.yml | 16 ++++++++-------- .github/workflows/wf-build-test.yml | 14 +++++++------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/wf-build-release-ci.yml b/.github/workflows/wf-build-release-ci.yml index 1f096321..f4d37590 100644 --- a/.github/workflows/wf-build-release-ci.yml +++ b/.github/workflows/wf-build-release-ci.yml @@ -10,11 +10,11 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 name: Checkout Code - name: Install additional .NET SDKs - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v4 with: dotnet-version: | 1.0.x @@ -26,7 +26,7 @@ jobs: uses: microsoft/setup-msbuild@v1 - name: Setup NuGet - uses: NuGet/setup-nuget@v1.0.2 + uses: NuGet/setup-nuget@v2 - name: Restore NuGet Packages run: nuget restore QRCoder.sln @@ -35,7 +35,7 @@ jobs: run: msbuild QRCoder.sln /p:Configuration=Release /p:NoWarn="1182" /p:NoWarn="1701" /nr:false /t:Rebuild - name: Upload artifacts - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4 with: name: Compiled project path: D:\a\qrcoder\qrcoder @@ -45,13 +45,13 @@ jobs: runs-on: windows-2019 steps: - name: Download artifacts - uses: actions/download-artifact@v1.0.0 + uses: actions/download-artifact@v4 with: name: Compiled project path: D:\a\qrcoder\qrcoder - name: Install additional .NET SDKs - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v4 with: dotnet-version: | 1.0.x @@ -126,13 +126,13 @@ jobs: GH_PKG_SEC: ${{ secrets.GH_PKG_REPO }} steps: - name: Download artifacts - uses: actions/download-artifact@v1.0.0 + uses: actions/download-artifact@v4 with: name: Compiled project path: D:\a\qrcoder\qrcoder - name: Install additional .NET SDKs - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v4 with: dotnet-version: | 1.0.x @@ -177,6 +177,6 @@ jobs: runs-on: windows-2019 steps: - name: Delete artifacts - uses: GeekyEggo/delete-artifact@v1.0.0 + uses: GeekyEggo/delete-artifact@v5 with: name: Compiled project diff --git a/.github/workflows/wf-build-release.yml b/.github/workflows/wf-build-release.yml index 003541be..d28f7efe 100644 --- a/.github/workflows/wf-build-release.yml +++ b/.github/workflows/wf-build-release.yml @@ -11,11 +11,11 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 name: Checkout Code - name: Install additional .NET SDKs - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v4 with: dotnet-version: | 1.0.x @@ -27,7 +27,7 @@ jobs: uses: microsoft/setup-msbuild@v1 - name: Setup NuGet - uses: NuGet/setup-nuget@v1.0.2 + uses: NuGet/setup-nuget@v2 - name: Restore NuGet Packages run: nuget restore QRCoder.sln @@ -36,7 +36,7 @@ jobs: run: msbuild QRCoder.sln /p:Configuration=Release /p:NoWarn="1182" /p:NoWarn="1701" /nr:false /t:Rebuild - name: Upload artifacts - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4 with: name: Compiled project path: D:\a\qrcoder\qrcoder @@ -46,7 +46,7 @@ jobs: runs-on: windows-2019 steps: - name: Download artifacts - uses: actions/download-artifact@v1.0.0 + uses: actions/download-artifact@v4 with: name: Compiled project path: D:\a\qrcoder\qrcoder @@ -126,13 +126,13 @@ jobs: GH_PKG_SEC: ${{ secrets.GH_PKG_REPO }} steps: - name: Download artifacts - uses: actions/download-artifact@v1.0.0 + uses: actions/download-artifact@v4 with: name: Compiled project path: D:\a\qrcoder\qrcoder - name: Install additional .NET SDKs - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v4 with: dotnet-version: | 1.0.x @@ -171,6 +171,6 @@ jobs: runs-on: windows-2019 steps: - name: Delete artifacts - uses: GeekyEggo/delete-artifact@v1.0.0 + uses: GeekyEggo/delete-artifact@v5 with: name: Compiled project diff --git a/.github/workflows/wf-build-test.yml b/.github/workflows/wf-build-test.yml index d6d016ec..7947f200 100644 --- a/.github/workflows/wf-build-test.yml +++ b/.github/workflows/wf-build-test.yml @@ -10,11 +10,11 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 name: Checkout Code - name: Install additional .NET SDKs - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v4 with: dotnet-version: | 1.0.x @@ -26,7 +26,7 @@ jobs: uses: microsoft/setup-msbuild@v1 - name: Setup NuGet - uses: NuGet/setup-nuget@v1.0.2 + uses: NuGet/setup-nuget@v2 - name: Restore NuGet Packages run: nuget restore QRCoder.sln @@ -35,7 +35,7 @@ jobs: run: msbuild QRCoder.sln /p:Configuration=Release /p:NoWarn="1182" /p:NoWarn="1701" /nr:false /t:Rebuild - name: Upload artifacts - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4 with: name: Compiled project path: D:\a\qrcoder\qrcoder @@ -45,13 +45,13 @@ jobs: runs-on: windows-2019 steps: - name: Download artifacts - uses: actions/download-artifact@v1.0.0 + uses: actions/download-artifact@v4 with: name: Compiled project path: D:\a\qrcoder\qrcoder - name: Install additional .NET SDKs - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v4 with: dotnet-version: | 1.0.x @@ -89,6 +89,6 @@ jobs: runs-on: windows-2019 steps: - name: Delete artifacts - uses: GeekyEggo/delete-artifact@v1.0.0 + uses: GeekyEggo/delete-artifact@v5 with: name: Compiled project