From 8c7250995d38ac02f1fd323c43905a8d2b5893ad Mon Sep 17 00:00:00 2001 From: "Frank A. Krueger" Date: Wed, 27 Mar 2024 13:30:14 -0700 Subject: [PATCH 01/11] Upgrade to .NET 8 --- .github/workflows/build.yml | 10 +++++++++- global.json | 5 +++++ tests/SQLite.Tests/SQLite.Tests.csproj | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 global.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ce8f4145..6502bcb8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,12 @@ jobs: VERSION_BUILD: ${{github.run_number}} run: | sed -i bak "s::.$VERSION_BUILD:g" Directory.Build.props + + - name: Set up .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0.100' + include-prerelease: true - name: Restore NuGets run: nuget restore SQLite.sln @@ -34,6 +40,7 @@ jobs: - name: Generate Code Coverage Report uses: danielpalme/ReportGenerator-GitHub-Action@4.8.4 + if: github.event_name == 'push' with: reports: 'tests/SQLite.Tests/coverage.xml' # REQUIRED # The coverage reports that should be parsed (separated by semicolon). Globbing is supported. targetdir: 'CoverageReport' # REQUIRED # The directory where the generated report should be saved. @@ -59,11 +66,12 @@ jobs: enable_jekyll: true - name: Package + if: github.event_name == 'push' run: | make nuget - uses: actions/upload-artifact@master + if: github.event_name == 'push' with: name: Packages path: PackagesOut - diff --git a/global.json b/global.json new file mode 100644 index 00000000..8a1056e1 --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "sdk": { + "version": "8.0.100" + } +} \ No newline at end of file diff --git a/tests/SQLite.Tests/SQLite.Tests.csproj b/tests/SQLite.Tests/SQLite.Tests.csproj index 1d9224f8..302319a2 100644 --- a/tests/SQLite.Tests/SQLite.Tests.csproj +++ b/tests/SQLite.Tests/SQLite.Tests.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net8.0 false From e8cb7b92059b4ea2ccbfcf6c22451176ccc322d5 Mon Sep 17 00:00:00 2001 From: "Frank A. Krueger" Date: Wed, 27 Mar 2024 13:32:25 -0700 Subject: [PATCH 02/11] Fix YAML --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6502bcb8..a7ef1825 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,10 +24,10 @@ jobs: sed -i bak "s::.$VERSION_BUILD:g" Directory.Build.props - name: Set up .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '8.0.100' - include-prerelease: true + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0.100' + include-prerelease: true - name: Restore NuGets run: nuget restore SQLite.sln From 9b226f1f70d9438d2823f577e811d659c1c06235 Mon Sep 17 00:00:00 2001 From: "Frank A. Krueger" Date: Wed, 27 Mar 2024 13:34:16 -0700 Subject: [PATCH 03/11] Use ubuntu --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a7ef1825..08400ee2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ on: jobs: build: - runs-on: macOS-latest + runs-on: ubuntu-latest steps: From 203ab54a40504e3c7547a868d6c5c4b9f8aa3c06 Mon Sep 17 00:00:00 2001 From: "Frank A. Krueger" Date: Wed, 27 Mar 2024 13:38:51 -0700 Subject: [PATCH 04/11] Upgrade ApiDiff to .NET 8 --- tests/ApiDiff/ApiDiff.csproj | 40 ++---------------------- tests/ApiDiff/Properties/AssemblyInfo.cs | 24 -------------- tests/ApiDiff/packages.config | 4 --- 3 files changed, 3 insertions(+), 65 deletions(-) delete mode 100644 tests/ApiDiff/Properties/AssemblyInfo.cs delete mode 100644 tests/ApiDiff/packages.config diff --git a/tests/ApiDiff/ApiDiff.csproj b/tests/ApiDiff/ApiDiff.csproj index 577d5393..06511a80 100644 --- a/tests/ApiDiff/ApiDiff.csproj +++ b/tests/ApiDiff/ApiDiff.csproj @@ -1,42 +1,9 @@ - - + - Debug - AnyCPU - 8.0.30703 - 2.0 - {1DEF735C-B973-4ED9-8446-7FFA6D0B410B} + net8.0 Exe - ApiDiff - ApiDiff - v4.6.1 - - true - full - false - bin\Debug - DEBUG; - prompt - 4 - true - - - true - bin\Release - prompt - 4 - true - - - - - ..\..\packages\ListDiff.1.0.7\lib\netstandard1.0\ListDiff.dll - - - - SQLite.cs @@ -45,7 +12,6 @@ - + - \ No newline at end of file diff --git a/tests/ApiDiff/Properties/AssemblyInfo.cs b/tests/ApiDiff/Properties/AssemblyInfo.cs deleted file mode 100644 index 4fb893c1..00000000 --- a/tests/ApiDiff/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. - -[assembly: AssemblyTitle ("ApiDiff")] -[assembly: AssemblyDescription ("")] -[assembly: AssemblyConfiguration ("")] -[assembly: AssemblyCompany ("")] -[assembly: AssemblyProduct ("")] -[assembly: AssemblyCopyright ("${AuthorCopyright}")] -[assembly: AssemblyTrademark ("")] -[assembly: AssemblyCulture ("")] - -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. - -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. - -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] diff --git a/tests/ApiDiff/packages.config b/tests/ApiDiff/packages.config deleted file mode 100644 index 48073015..00000000 --- a/tests/ApiDiff/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file From 275b6d0951c0a4a2be7c60643785cb5a39a70036 Mon Sep 17 00:00:00 2001 From: "Frank A. Krueger" Date: Wed, 27 Mar 2024 13:45:05 -0700 Subject: [PATCH 05/11] Update code coverage --- .github/workflows/build.yml | 3 +++ Makefile | 13 +------------ tests/SQLite.Tests/SQLite.Tests.csproj | 2 +- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 08400ee2..f976ce26 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,6 +28,9 @@ jobs: with: dotnet-version: '8.0.100' include-prerelease: true + + - name: Install Code Coverarage Tool + run: dotnet tool install --global dotnet-reportgenerator-globaltool - name: Restore NuGets run: nuget restore SQLite.sln diff --git a/Makefile b/Makefile index c60e00b8..42cd34dd 100644 --- a/Makefile +++ b/Makefile @@ -3,18 +3,7 @@ SRC=src/SQLite.cs src/SQLiteAsync.cs PACKAGES_OUT=$(abspath PackagesOut) -all: test nuget - -test: tests/bin/Release/SQLite.Tests.dll tests/ApiDiff/bin/Release/ApiDiff.exe - mono packages/NUnit.ConsoleRunner.3.10.0/tools/nunit3-console.exe tests/bin/Release/SQLite.Tests.dll --labels=On --trace=Info - mono tests/ApiDiff/bin/Release/ApiDiff.exe - -tests/bin/Release/SQLite.Tests.dll: tests/SQLite.Tests.csproj $(SRC) - nuget restore SQLite.sln - msbuild /p:Configuration=Release tests/SQLite.Tests.csproj - -tests/ApiDiff/bin/Release/ApiDiff.exe: tests/ApiDiff/ApiDiff.csproj $(SRC) - msbuild /p:Configuration=Release tests/ApiDiff/ApiDiff.csproj +all: nuget nuget: pclnuget basenuget sqlciphernuget staticnuget diff --git a/tests/SQLite.Tests/SQLite.Tests.csproj b/tests/SQLite.Tests/SQLite.Tests.csproj index 302319a2..5c14b15d 100644 --- a/tests/SQLite.Tests/SQLite.Tests.csproj +++ b/tests/SQLite.Tests/SQLite.Tests.csproj @@ -8,7 +8,7 @@ - + From d42a7dd61997d03904138ec50d7b72eb30c0b3ea Mon Sep 17 00:00:00 2001 From: "Frank A. Krueger" Date: Wed, 27 Mar 2024 13:46:48 -0700 Subject: [PATCH 06/11] Use global.json for workflow --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f976ce26..93f0f477 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,8 +26,7 @@ jobs: - name: Set up .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: '8.0.100' - include-prerelease: true + global-json-file: global.json - name: Install Code Coverarage Tool run: dotnet tool install --global dotnet-reportgenerator-globaltool From 6f9f13507d64729560ca4b940954183253b0e617 Mon Sep 17 00:00:00 2001 From: "Frank A. Krueger" Date: Wed, 27 Mar 2024 13:48:29 -0700 Subject: [PATCH 07/11] Fix linux --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 93f0f477..ec9ce37f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: env: VERSION_BUILD: ${{github.run_number}} run: | - sed -i bak "s::.$VERSION_BUILD:g" Directory.Build.props + sed -i.bak "s::.$VERSION_BUILD:g" Directory.Build.props - name: Set up .NET uses: actions/setup-dotnet@v4 From 7283711d3774aa520e9737dcfd8ef3798d9804b2 Mon Sep 17 00:00:00 2001 From: "Frank A. Krueger" Date: Wed, 27 Mar 2024 13:51:21 -0700 Subject: [PATCH 08/11] Remove iOS test --- SQLite.sln | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/SQLite.sln b/SQLite.sln index 3d8e2ad0..a6329bc1 100644 --- a/SQLite.sln +++ b/SQLite.sln @@ -9,8 +9,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{FECC0E44-E626-49CB-BD8B-0CFBD93FBEFF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQLiteTestsiOS", "tests\SQLite.Tests.iOS\SQLiteTestsiOS.csproj", "{81850129-71C3-40C7-A48B-AA5D2C2E365E}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQLite-net-std", "nuget\SQLite-net-std\SQLite-net-std.csproj", "{081D08D6-10F1-431B-88FE-469FD9FE898C}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiDiff", "tests\ApiDiff\ApiDiff.csproj", "{1DEF735C-B973-4ED9-8446-7FFA6D0B410B}" @@ -33,18 +31,6 @@ Global Debug|iPhone = Debug|iPhone EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {81850129-71C3-40C7-A48B-AA5D2C2E365E}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator - {81850129-71C3-40C7-A48B-AA5D2C2E365E}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator - {81850129-71C3-40C7-A48B-AA5D2C2E365E}.Release|Any CPU.ActiveCfg = Release|iPhone - {81850129-71C3-40C7-A48B-AA5D2C2E365E}.Release|Any CPU.Build.0 = Release|iPhone - {81850129-71C3-40C7-A48B-AA5D2C2E365E}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator - {81850129-71C3-40C7-A48B-AA5D2C2E365E}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator - {81850129-71C3-40C7-A48B-AA5D2C2E365E}.Release|iPhone.ActiveCfg = Release|iPhone - {81850129-71C3-40C7-A48B-AA5D2C2E365E}.Release|iPhone.Build.0 = Release|iPhone - {81850129-71C3-40C7-A48B-AA5D2C2E365E}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator - {81850129-71C3-40C7-A48B-AA5D2C2E365E}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator - {81850129-71C3-40C7-A48B-AA5D2C2E365E}.Debug|iPhone.ActiveCfg = Debug|iPhone - {81850129-71C3-40C7-A48B-AA5D2C2E365E}.Debug|iPhone.Build.0 = Debug|iPhone {081D08D6-10F1-431B-88FE-469FD9FE898C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {081D08D6-10F1-431B-88FE-469FD9FE898C}.Debug|Any CPU.Build.0 = Debug|Any CPU {081D08D6-10F1-431B-88FE-469FD9FE898C}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -119,7 +105,6 @@ Global {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Debug|iPhone.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution - {81850129-71C3-40C7-A48B-AA5D2C2E365E} = {FECC0E44-E626-49CB-BD8B-0CFBD93FBEFF} {1DEF735C-B973-4ED9-8446-7FFA6D0B410B} = {FECC0E44-E626-49CB-BD8B-0CFBD93FBEFF} {80B66A43-B358-4438-BF06-6351B86B121A} = {FECC0E44-E626-49CB-BD8B-0CFBD93FBEFF} EndGlobalSection From 3e43cbc20c10c62de6b12a8d772fe767787ad0a3 Mon Sep 17 00:00:00 2001 From: "Frank A. Krueger" Date: Wed, 27 Mar 2024 13:53:03 -0700 Subject: [PATCH 09/11] Use dotnet restore --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ec9ce37f..680c73f3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,7 @@ jobs: run: dotnet tool install --global dotnet-reportgenerator-globaltool - name: Restore NuGets - run: nuget restore SQLite.sln + run: dotnet restore SQLite.sln - name: Build and Test run: | From 352294fafbcbbfc688099c73b41ed5417a2e2465 Mon Sep 17 00:00:00 2001 From: "Frank A. Krueger" Date: Wed, 27 Mar 2024 13:56:25 -0700 Subject: [PATCH 10/11] Fix throw warning --- src/SQLite.cs | 4 ++-- src/SQLiteAsync.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SQLite.cs b/src/SQLite.cs index 5b6941c3..bef5648e 100644 --- a/src/SQLite.cs +++ b/src/SQLite.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2009-2021 Krueger Systems, Inc. +// Copyright (c) 2009-2024 Krueger Systems, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -2003,7 +2003,7 @@ public int Update (object obj, Type objType) throw NotNullConstraintViolationException.New (ex, map, obj); } - throw ex; + throw; } if (rowsAffected > 0) diff --git a/src/SQLiteAsync.cs b/src/SQLiteAsync.cs index e3067619..3d37a56b 100644 --- a/src/SQLiteAsync.cs +++ b/src/SQLiteAsync.cs @@ -1,5 +1,5 @@ // -// Copyright (c) 2012-2021 Krueger Systems, Inc. +// Copyright (c) 2012-2024 Krueger Systems, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal From 3d25c8b4f3eb94112625d1784be1eb33a8a3cc1f Mon Sep 17 00:00:00 2001 From: "Frank A. Krueger" Date: Wed, 27 Mar 2024 14:00:38 -0700 Subject: [PATCH 11/11] Add async diff check --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 680c73f3..9e146e95 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,6 +39,11 @@ jobs: set -e cd tests/SQLite.Tests dotnet test /p:AltCover=true /p:AltCoverForce=true "/p:AltCoverTypeFilter=SQLite.Tests.*" + + - name: Verify Async API Matches Sync API + run: | + set -e + dotnet run --project tests/ApiDiff/ApiDiff.csproj - name: Generate Code Coverage Report uses: danielpalme/ReportGenerator-GitHub-Action@4.8.4