From 7cfff0666ef8461af44cb78904c904cd1825a90a Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Fri, 27 Aug 2021 22:32:58 +0200 Subject: [PATCH] Run .NET core tests on Win81 (#2580) --- .github/templates/main.yml | 14 ++++++++++++ .github/workflows/main.yml | 47 ++++++++++++++++++++++++++++++++++++++ CHANGELOG.md | 1 + 3 files changed, 62 insertions(+) diff --git a/.github/templates/main.yml b/.github/templates/main.yml index 84bde6d4dc..881053addc 100644 --- a/.github/templates/main.yml +++ b/.github/templates/main.yml @@ -372,6 +372,20 @@ jobs: include-prerelease: true - #@ template.replace(dotnetPublishAndRunTests("Tests/Realm.Tests", "${{ matrix.targetFramework }}", "Realm.Tests --result=TestResults.xml --labels=After")) - #@ publishTestsResults("TestResults.xml", ".NET (${{ matrix.os }}, ${{ matrix.targetFramework }})") + #! This should be folded in run-tests-netcore once we fix the TLS issues on win81 + run-tests-netcore-win81: + name: Test .NET on Win81 + needs: build-packages + runs-on: win81 + strategy: + fail-fast: false + matrix: + targetFramework: [ netcoreapp3.1, net5.0 ] + steps: + - #@ template.replace(checkoutCode()) + - #@ template.replace(fetchPackageArtifacts()) + - #@ template.replace(dotnetPublishAndRunTests("Tests/Realm.Tests", "${{ matrix.targetFramework }}", "Realm.Tests --result=TestResults.xml --labels=After")) + - #@ publishTestsResults("TestResults.xml", ".NET (win81, ${{ matrix.targetFramework }})") run-tests-xamarin-macos: runs-on: macos-latest name: Test Xamarin.macOS diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 10ffd4dbb5..5cad7eb637 100755 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -573,6 +573,53 @@ jobs: files: TestResults.xml comment_mode: "off" check_name: Results .NET (${{ matrix.os }}, ${{ matrix.targetFramework }}) + run-tests-netcore-win81: + name: Test .NET on Win81 + needs: build-packages + runs-on: win81 + strategy: + fail-fast: false + matrix: + targetFramework: + - netcoreapp3.1 + - net5.0 + steps: + - name: Disable Analytics + run: | + echo "REALM_DISABLE_ANALYTICS=true" >> $GITHUB_ENV + - name: Checkout code + uses: actions/checkout@v2 + with: + submodules: false + ref: ${{ github.event.pull_request.head.sha }} + - name: Register csc problem matcher + run: echo "::add-matcher::.github/problem-matchers/csc.json" + - name: Register msvc problem matcher + run: echo "::add-matcher::.github/problem-matchers/msvc.json" + - name: Fetch Realm + uses: actions/download-artifact@v2 + with: + name: Realm.${{ needs.build-packages.outputs.package_version }} + path: ${{ github.workspace }}/Realm/packages/ + - name: Fetch Realm.Fody + uses: actions/download-artifact@v2 + with: + name: Realm.Fody.${{ needs.build-packages.outputs.package_version }} + path: ${{ github.workspace }}/Realm/packages/ + - name: Publish Tests/Realm.Tests + run: dotnet publish Tests/Realm.Tests -c Release -f ${{ matrix.targetFramework }} -r ${{ (runner.os == 'macOS' && 'osx-x64') || (runner.os == 'Windows' && 'win-x64') || (runner.os == 'Linux' && 'linux-x64') || '???' }} -p:AdditionalFrameworks=${{ matrix.targetFramework }} -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ needs.build-packages.outputs.package_version }} --no-self-contained + - name: Output executable path + id: dotnet-publish + run: echo '::set-output name=executable-path::./Tests/Realm.Tests/bin/Release/${{ matrix.targetFramework }}/${{ (runner.os == 'macOS' && 'osx-x64') || (runner.os == 'Windows' && 'win-x64') || (runner.os == 'Linux' && 'linux-x64') || '???' }}' + - name: Run the tests + run: ${{ steps.dotnet-publish.outputs.executable-path }}/Realm.Tests --result=TestResults.xml --labels=After + - name: Publish Unit Test Results + uses: EnricoMi/publish-unit-test-result-action/composite@v1 + if: always() + with: + files: TestResults.xml + comment_mode: "off" + check_name: Results .NET (win81, ${{ matrix.targetFramework }}) run-tests-xamarin-macos: runs-on: macos-latest name: Test Xamarin.macOS diff --git a/CHANGELOG.md b/CHANGELOG.md index bc82611273..e0a4584070 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ * Started tracking package and wrapper sizes over time. (Issue [#2225](https://github.com/realm/realm-dotnet/issues/2225)) * Removed the `[Serializable]` attribute from RealmObjectBase as `BinarySerializer` is now obsolete. (PR [#2578](https://github.com/realm/realm-dotnet/pull/2578)) * Added code coverage job to Github Actions. (PR [#2581](https://github.com/realm/realm-dotnet/pull/2581)) +* Added CI tests running on Windows 8.1 . (PR [#2580](https://github.com/realm/realm-dotnet/pull/2580)) ## 10.3.0 (2021-07-07)