From 90c03e8a654feae62a79cab2c5ee875cae881e3e Mon Sep 17 00:00:00 2001 From: Michiel Oda Date: Wed, 19 Feb 2025 09:03:24 +0100 Subject: [PATCH] Improve robustness for Ubuntu --- .github/workflows/release.yml | 9 +++++++++ Sdk/Sdk.csproj | 2 ++ SdkTests/Helpers/ProjectReferencesHelperTests.cs | 12 +++++++----- SdkTests/SdkTests.csproj | 2 ++ 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dfd2dea..973b844 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,3 +30,12 @@ jobs: pfx: ${{ secrets.PFX }} pfxPassword: ${{ secrets.PFXPASSWORD }} nugetApiKey: ${{ secrets.NUGETAPIKEY }} + + Tests-Ubuntu: + runs-on: ubuntu-22.04 # Latest misses mono for .NET Framework + + steps: + - uses: actions/checkout@v4 + + - name: Test + run: dotnet test -c Release diff --git a/Sdk/Sdk.csproj b/Sdk/Sdk.csproj index bbed8bc..a7ce55a 100644 --- a/Sdk/Sdk.csproj +++ b/Sdk/Sdk.csproj @@ -43,6 +43,8 @@ By integrating this SDK into your build process, you can easily generate install + + diff --git a/SdkTests/Helpers/ProjectReferencesHelperTests.cs b/SdkTests/Helpers/ProjectReferencesHelperTests.cs index bb087d0..2992283 100644 --- a/SdkTests/Helpers/ProjectReferencesHelperTests.cs +++ b/SdkTests/Helpers/ProjectReferencesHelperTests.cs @@ -1,6 +1,8 @@ namespace SdkTests.Helpers { using FluentAssertions; + + using Skyline.DataMiner.CICD.FileSystem; using Skyline.DataMiner.CICD.Parsers.Common.VisualStudio.Projects; using Skyline.DataMiner.Sdk.Helpers; @@ -11,7 +13,7 @@ public class ProjectReferencesHelperTests public void TryResolveProjectReferencesTest_DefaultProjectReferences() { // Arrange - string packageProjectPath = Path.Combine(TestHelper.GetTestFilesDirectory(), "Package 1", "PackageProject", "PackageProject.csproj"); + string packageProjectPath = FileSystem.Instance.Path.Combine(TestHelper.GetTestFilesDirectory(), "Package 1", "PackageProject", "PackageProject.csproj"); Project packageProject = Project.Load(packageProjectPath); // Act @@ -31,7 +33,7 @@ public void TryResolveProjectReferencesTest_DefaultProjectReferences() public void TryResolveProjectReferencesTest_ExcludeScript() { // Arrange - string packageProjectPath = Path.Combine(TestHelper.GetTestFilesDirectory(), "Package 2", "PackageProject", "PackageProject.csproj"); + string packageProjectPath = FileSystem.Instance.Path.Combine(TestHelper.GetTestFilesDirectory(), "Package 2", "PackageProject", "PackageProject.csproj"); Project packageProject = Project.Load(packageProjectPath); // Act @@ -50,7 +52,7 @@ public void TryResolveProjectReferencesTest_ExcludeScript() public void TryResolveProjectReferencesTest_PackageProjectOnly() { // Arrange - string packageProjectPath = Path.Combine(TestHelper.GetTestFilesDirectory(), "Package 3", "MyPackage", "MyPackage.csproj"); + string packageProjectPath = FileSystem.Instance.Path.Combine(TestHelper.GetTestFilesDirectory(), "Package 3", "MyPackage", "MyPackage.csproj"); Project packageProject = Project.Load(packageProjectPath); // Act @@ -69,7 +71,7 @@ public void TryResolveProjectReferencesTest_PackageProjectOnly() public void TryResolveProjectReferencesTest_DefaultProjectReferences_NothingSpecifiedInFile() { // Arrange - string packageProjectPath = Path.Combine(TestHelper.GetTestFilesDirectory(), "Package 4", "PackageProject", "PackageProject.csproj"); + string packageProjectPath = FileSystem.Instance.Path.Combine(TestHelper.GetTestFilesDirectory(), "Package 4", "PackageProject", "PackageProject.csproj"); Project packageProject = Project.Load(packageProjectPath); // Act @@ -89,7 +91,7 @@ public void TryResolveProjectReferencesTest_DefaultProjectReferences_NothingSpec public void TryResolveProjectReferencesTest_SolutionFilter() { // Arrange - string packageProjectPath = Path.Combine(TestHelper.GetTestFilesDirectory(), "Package 5", "MyPackage", "MyPackage.csproj"); + string packageProjectPath = FileSystem.Instance.Path.Combine(TestHelper.GetTestFilesDirectory(), "Package 5", "MyPackage", "MyPackage.csproj"); Project packageProject = Project.Load(packageProjectPath); // Act diff --git a/SdkTests/SdkTests.csproj b/SdkTests/SdkTests.csproj index a959c42..234d487 100644 --- a/SdkTests/SdkTests.csproj +++ b/SdkTests/SdkTests.csproj @@ -16,6 +16,8 @@ + +