Skip to content

Commit

Permalink
Merge pull request #5 from shimat/linux_native
Browse files Browse the repository at this point in the history
Add tests for Linux
  • Loading branch information
shimat authored Jun 3, 2024
2 parents 362a5a1 + 6c5c27c commit 2865966
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 10 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
test-windows:
runs-on: windows-latest
runs-on: windows-2022

steps:
- uses: actions/checkout@v4
Expand All @@ -22,7 +22,28 @@ jobs:
run: dotnet restore

- name: Build
run: dotnet build --no-restore --framework net48
run: dotnet build --no-restore --framework net48 ./LibSVMSharp.Tests/LibSVMSharp.Tests.csproj

- name: Test
run: dotnet test --no-build --framework net48 --verbosity normal

test-linux:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore --framework net8 ./LibSVMSharp.Tests/LibSVMSharp.Tests.csproj

- name: Test
run: dotnet test --no-build --framework net8 --verbosity normal

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net48</TargetFramework>
<TargetFrameworks>net48;net8</TargetFrameworks>
<AssemblyTitle>LibSVMsharp.Examples.Classification</AssemblyTitle>
<Product>LibSVMsharp.Examples.Classification</Product>
<Copyright>Copyright © 2014</Copyright>
Expand All @@ -21,7 +21,7 @@
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
</Target>
<ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net48' ">
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net48</TargetFramework>
<TargetFrameworks>net48;net8</TargetFrameworks>
<AssemblyTitle>LibSVMsharp.Examples.RapidPrediction</AssemblyTitle>
<Product>LibSVMsharp.Examples.RapidPrediction</Product>
<Copyright>Copyright © 2014</Copyright>
Expand All @@ -20,7 +20,7 @@
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
</Target>
<ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net48' ">
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
Expand Down
15 changes: 11 additions & 4 deletions LibSVMsharp/LibSVMsharp.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8;net48</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net48</TargetFrameworks>
<AssemblyTitle>LibSVMsharp</AssemblyTitle>
<Product>LibSVMsharp</Product>
<Copyright>Copyright © 2014</Copyright>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>12</LangVersion>
<NoWarn>CA1401;</NoWarn>
</PropertyGroup>
<PropertyGroup>
<PackageId>LibSVMsharpCore</PackageId>
<Version>0.1.0</Version>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/shimat/LibSVMsharp</PackageProjectUrl>
<RepositoryUrl>https://github.com/shimat/LibSVMsharp.git</RepositoryUrl>
<Description>Some text.</Description>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>full</DebugType>
</PropertyGroup>
Expand All @@ -27,8 +35,7 @@
</None>
</ItemGroup>
<ItemGroup>
<Content Include="libsvm.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="native/libsvm.dll" PackagePath="runtimes/win-x64/native" Pack="true" />
<None Include="native/liblibsvm.so" PackagePath="runtimes/linux-x64/native" Pack="true" />
</ItemGroup>
</Project>
Binary file added LibSVMsharp/native/liblibsvm.so
Binary file not shown.
File renamed without changes.

0 comments on commit 2865966

Please sign in to comment.