From c41d01ac5ecfa2d61db123dab4790d1216c048ee Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Thu, 14 Mar 2024 11:57:08 -0500 Subject: [PATCH 1/9] Also build for net8.0 --- src/ChorusMerge/ChorusMerge.csproj | 2 +- src/LibChorusTests/LibChorus.Tests.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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/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 From a0fc9649dfd9c951174311b95476e303822b12a6 Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Thu, 14 Mar 2024 12:01:03 -0500 Subject: [PATCH 2/9] Make GHA workflow run .NET 6 and 8 --- .github/workflows/ci+cd.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci+cd.yml b/.github/workflows/ci+cd.yml index cf5c2be5..489ee49f 100644 --- a/.github/workflows/ci+cd.yml +++ b/.github/workflows/ci+cd.yml @@ -35,14 +35,16 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@c0d4ad69d8bd405d234f1c9166d383b7a4f69ed8 # v2.1.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' From 9a0147b9b783de47b52d7dbf163bb4905752fceb Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Thu, 14 Mar 2024 12:05:04 -0500 Subject: [PATCH 3/9] 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. --- .github/workflows/ci+cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci+cd.yml b/.github/workflows/ci+cd.yml index 489ee49f..3271e060 100644 --- a/.github/workflows/ci+cd.yml +++ b/.github/workflows/ci+cd.yml @@ -33,7 +33,7 @@ jobs: fetch-depth: 0 # fetch full history for GitVersion - name: Setup .NET - uses: actions/setup-dotnet@c0d4ad69d8bd405d234f1c9166d383b7a4f69ed8 # v2.1.0 + uses: actions/setup-dotnet@v4.0.0 with: dotnet-version: | 6.0.x From 457309a217f7b5918c530b4226de05ea0a4ff4cd Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Thu, 14 Mar 2024 12:07:47 -0500 Subject: [PATCH 4/9] Fix RuntimeIdentifiers --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 376030a7a0f36fbaeedd9410915dbcdac0540f42 Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Thu, 14 Mar 2024 14:46:41 -0500 Subject: [PATCH 5/9] Temporarily disable tests in CI The tests take two hours to run now that we have net461, net6.0, and net8.0 target frameworks. They're all passing except for one that's known to be flaky and timing-dependant, so it's safe to disable them while we work on fixing the part of the build that comes after the tests. Then once that's working we'll revert this commit. --- .github/workflows/ci+cd.yml | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci+cd.yml b/.github/workflows/ci+cd.yml index 3271e060..6f0dc172 100644 --- a/.github/workflows/ci+cd.yml +++ b/.github/workflows/ci+cd.yml @@ -52,20 +52,24 @@ jobs: # Unfortunately we need two test steps because we need different filters. # We could conditionally set an environment variable, but unfortunately # the syntax to access that is different on Windows vs Linux. - - name: Test on Linux - run: dotnet test --no-build -c Release --filter TestCategory!=RequiresUI -- NUnit.TestOutputXml=TestResults - if: matrix.os == 'ubuntu-latest' - - - name: Test on Windows - run: dotnet test --no-build -c Release --filter TestCategory!=SkipOnBuildServer -- NUnit.TestOutputXml=TestResults - if: matrix.os == 'windows-latest' - - name: Upload Test Results - if: always() - uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 - with: - name: Test Results (${{matrix.os}}) - path: "**/TestResults/*.xml" + # Tests disabled temporarily while we iterate on the build process. They're all working except for the one flaky one, + # but they take two hours to run so it's hard to iterate. - 2024-03 RM + # CODE REVIEW NOTE: If I forget to uncomment this block before submitting the PR for review, yell at me in code review. + # - name: Test on Linux + # run: dotnet test --no-build -c Release --filter TestCategory!=RequiresUI -- NUnit.TestOutputXml=TestResults + # if: matrix.os == 'ubuntu-latest' + + # - name: Test on Windows + # run: dotnet test --no-build -c Release --filter TestCategory!=SkipOnBuildServer -- NUnit.TestOutputXml=TestResults + # if: matrix.os == 'windows-latest' + + # - name: Upload Test Results + # if: always() + # uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 + # with: + # name: Test Results (${{matrix.os}}) + # path: "**/TestResults/*.xml" - name: Checkout Chorus Help # required for Chorus Merge Module uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 From 794fe18d0c62c7133aa19ee3e7dd79baa6801324 Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Thu, 14 Mar 2024 14:59:39 -0500 Subject: [PATCH 6/9] Suppress WiX validation as per WiX docs --- src/Installer/ChorusMergeModule.wixproj | 2 ++ 1 file changed, 2 insertions(+) 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 From 341dd6bca3358708847a1daddec63bf177a3f2b4 Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Thu, 14 Mar 2024 15:07:36 -0500 Subject: [PATCH 7/9] Revert "Temporarily disable tests in CI" This reverts commit 376030a7a0f36fbaeedd9410915dbcdac0540f42. --- .github/workflows/ci+cd.yml | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci+cd.yml b/.github/workflows/ci+cd.yml index 6f0dc172..3271e060 100644 --- a/.github/workflows/ci+cd.yml +++ b/.github/workflows/ci+cd.yml @@ -52,24 +52,20 @@ jobs: # Unfortunately we need two test steps because we need different filters. # We could conditionally set an environment variable, but unfortunately # the syntax to access that is different on Windows vs Linux. + - name: Test on Linux + run: dotnet test --no-build -c Release --filter TestCategory!=RequiresUI -- NUnit.TestOutputXml=TestResults + if: matrix.os == 'ubuntu-latest' + + - name: Test on Windows + run: dotnet test --no-build -c Release --filter TestCategory!=SkipOnBuildServer -- NUnit.TestOutputXml=TestResults + if: matrix.os == 'windows-latest' - # Tests disabled temporarily while we iterate on the build process. They're all working except for the one flaky one, - # but they take two hours to run so it's hard to iterate. - 2024-03 RM - # CODE REVIEW NOTE: If I forget to uncomment this block before submitting the PR for review, yell at me in code review. - # - name: Test on Linux - # run: dotnet test --no-build -c Release --filter TestCategory!=RequiresUI -- NUnit.TestOutputXml=TestResults - # if: matrix.os == 'ubuntu-latest' - - # - name: Test on Windows - # run: dotnet test --no-build -c Release --filter TestCategory!=SkipOnBuildServer -- NUnit.TestOutputXml=TestResults - # if: matrix.os == 'windows-latest' - - # - name: Upload Test Results - # if: always() - # uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 - # with: - # name: Test Results (${{matrix.os}}) - # path: "**/TestResults/*.xml" + - name: Upload Test Results + if: always() + uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 + with: + name: Test Results (${{matrix.os}}) + path: "**/TestResults/*.xml" - name: Checkout Chorus Help # required for Chorus Merge Module uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 From ba7db05ceda7237087dd1878beb5a583f9546eae Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Thu, 14 Mar 2024 17:15:23 -0500 Subject: [PATCH 8/9] 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. --- src/LibChorusTests/notes/AnnotationRepositoryTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 8fe98b568ca65159501a0cc61a81e341b85c328a Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Mon, 18 Mar 2024 10:51:13 +0700 Subject: [PATCH 9/9] Use SHA rather than tag for GitHub Actions ref --- .github/workflows/ci+cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci+cd.yml b/.github/workflows/ci+cd.yml index 3271e060..b7a8733c 100644 --- a/.github/workflows/ci+cd.yml +++ b/.github/workflows/ci+cd.yml @@ -33,7 +33,7 @@ jobs: fetch-depth: 0 # fetch full history for GitVersion - name: Setup .NET - uses: actions/setup-dotnet@v4.0.0 + uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0 with: dotnet-version: | 6.0.x