Skip to content

Commit

Permalink
MasOS: pipeline fixes + IsSupported() unification
Browse files Browse the repository at this point in the history
  • Loading branch information
gluschenko committed Oct 2, 2024
1 parent 47d1009 commit 9342f40
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/github-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,12 @@ jobs:
run: dotnet test -c CI

test-nugets-macos:
name: 🧪 Test on macOS (${{matrix.task.os}})
runs-on: ${{matrix.task.os}}
name: 🧪 Test on macOS (${{matrix.os}})
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
task:
os:
- macos-14
- macos-13
needs: build-nugets
Expand Down
6 changes: 5 additions & 1 deletion src/LanguageIdentification.Lingua/LinguaDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ internal LinguaDetector(LinguaDetectorBuilder builder)

public static bool IsSupported()
{
return RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
return RuntimeInformation.OSArchitecture switch
{
Architecture.X64 when RuntimeInformation.IsOSPlatform(OSPlatform.Linux) => true,
_ => false,
};
}

/// <summary>
Expand Down
6 changes: 5 additions & 1 deletion src/LanguageIdentification.MediaPipe/MediaPipeDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ public MediaPipeDetector(MediaPipeOptions options)

public static bool IsSupported()
{
return RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
return RuntimeInformation.OSArchitecture switch
{
Architecture.X64 when RuntimeInformation.IsOSPlatform(OSPlatform.Linux) => true,
_ => false,
};
}

public IEnumerable<MediaPipePrediction> PredictLanguages(string text)
Expand Down
6 changes: 5 additions & 1 deletion src/LanguageIdentification.Whatlang/WhatlangDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ public WhatlangDetector()

public static bool IsSupported()
{
return RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
return RuntimeInformation.OSArchitecture switch
{
Architecture.X64 when RuntimeInformation.IsOSPlatform(OSPlatform.Linux) => true,
_ => false,
};
}

/// <summary>
Expand Down

0 comments on commit 9342f40

Please sign in to comment.