From 04e1e281629260cdc89e718f418d9c0491859a44 Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Thu, 21 Mar 2024 00:51:13 +0700 Subject: [PATCH] Also build for net8.0 (#332) * Also build for net8.0 * Make GHA workflow run .NET 6 and 8 * Update setup-dotnet action v2.1.0 was still trying to build against win7-x32 runtimes, which are no longer offered in .NET 8. If we're using recent .NET, we need a recent setup-dotnet version. * Fix RuntimeIdentifiers * Suppress WiX validation as per WiX docs * Ignore flaky test on Linux, too The GitHub Actions runners are apparently slow to deliver filesystem notifications, which is exactly the scenario that makes this test useless. It's already disabled on Windows; there's no reason for it to cause the CI build to fail all the time when it's the only failing test. --- .github/workflows/ci+cd.yml | 8 +++++--- Directory.Build.props | 2 +- src/ChorusMerge/ChorusMerge.csproj | 2 +- src/Installer/ChorusMergeModule.wixproj | 2 ++ src/LibChorusTests/LibChorus.Tests.csproj | 2 +- src/LibChorusTests/notes/AnnotationRepositoryTests.cs | 2 +- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci+cd.yml b/.github/workflows/ci+cd.yml index cf5c2be5..b7a8733c 100644 --- a/.github/workflows/ci+cd.yml +++ b/.github/workflows/ci+cd.yml @@ -33,16 +33,18 @@ jobs: fetch-depth: 0 # fetch full history for GitVersion - name: Setup .NET - uses: actions/setup-dotnet@c0d4ad69d8bd405d234f1c9166d383b7a4f69ed8 # v2.1.0 + uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0 with: - dotnet-version: 6.0.x + dotnet-version: | + 6.0.x + 8.0.x - name: Restore run: dotnet restore - name: Build run: dotnet build --no-restore -c Release - + - name: Install python2 for test execution run: sudo apt-get install python2 if: matrix.os == 'ubuntu-latest' diff --git a/Directory.Build.props b/Directory.Build.props index c0301c68..264f8f66 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -29,6 +29,6 @@ See full changelog at https://github.com/sillsdev/chorus/blob/master/CHANGELOG.m RuntimeIdentifiers when building with .NET 5 on AppVeyor. Otherwise the build fails with an error that there is no target for'net461/win7-x86'. --> AnyCPU - win7-x86;win7-x64 + win-x86;win-x64 \ No newline at end of file diff --git a/src/ChorusMerge/ChorusMerge.csproj b/src/ChorusMerge/ChorusMerge.csproj index aede7c9e..562d4a4a 100644 --- a/src/ChorusMerge/ChorusMerge.csproj +++ b/src/ChorusMerge/ChorusMerge.csproj @@ -5,7 +5,7 @@ ChorusMerge SIL.Chorus.ChorusMerge Exe - net461;net6.0 + net461;net6.0;net8.0 https://github.com/sillsdev/chorus.git true diff --git a/src/Installer/ChorusMergeModule.wixproj b/src/Installer/ChorusMergeModule.wixproj index cb054a78..63a9e0e6 100644 --- a/src/Installer/ChorusMergeModule.wixproj +++ b/src/Installer/ChorusMergeModule.wixproj @@ -18,6 +18,8 @@ ProductVersion=$(ProductVersion) Debug;$(DefineConstants) True + + true diff --git a/src/LibChorusTests/LibChorus.Tests.csproj b/src/LibChorusTests/LibChorus.Tests.csproj index 09123e66..1654a1ba 100644 --- a/src/LibChorusTests/LibChorus.Tests.csproj +++ b/src/LibChorusTests/LibChorus.Tests.csproj @@ -4,7 +4,7 @@ LibChorus.Tests LibChorus.Tests Unit tests for LibChorus.dll - net461;net6.0 + net461;net6.0;net8.0 true false diff --git a/src/LibChorusTests/notes/AnnotationRepositoryTests.cs b/src/LibChorusTests/notes/AnnotationRepositoryTests.cs index 9c2e7882..441a8438 100644 --- a/src/LibChorusTests/notes/AnnotationRepositoryTests.cs +++ b/src/LibChorusTests/notes/AnnotationRepositoryTests.cs @@ -224,7 +224,7 @@ public void AddAnnotation_NotifiesIndices() // the setup of the watcher or the code in Save that tries to prevent the notifications at all, // which is more than half the code this test wants to exercise. [Test] - [Platform(Exclude = "Win", Reason = "flaky (on both platforms)")] + [Ignore("flaky (on both platforms)")] public void ExternalFileModification_NotifiesIndices_ButSaveDoesNot() { const int SleepTime = 25; // milliseconds