Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 100 additions & 10 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@

name: dotnet

permissions: read-all

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
# workflow_dispatch:
# inputs:
# version:
# description: 'Release version to tag and create'
# required: false
workflow_dispatch:
inputs:
version:
description: 'Release version to tag and create'
required: false

env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
NuGetDirectory: ${{ github.workspace }}/nuget

jobs:
build:
Expand All @@ -28,6 +31,8 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Important for Nerdbank.GitVersioning to calculate versions
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
Expand All @@ -37,8 +42,93 @@ jobs:
- name: Build
run: dotnet build -c ${{ matrix.configuration }} --no-restore
- name: Test
run: dotnet test -c ${{ matrix.configuration }} --no-build --verbosity normal
# - name: Upload coverage reports to Codecov
# uses: codecov/codecov-action@v3
# with:
# flags: ${{ matrix.os }},${{ matrix.configuration }}
run: dotnet test -c ${{ matrix.configuration }} --no-build --verbosity normal --collect:"XPlat Code Coverage"
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
flags: ${{ matrix.os }},${{ matrix.configuration }}

format:
strategy:
matrix:
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
global-json-file: global.json
- name: Format verify no changes
run: dotnet format --verify-no-changes

pack:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Important for Nerdbank.GitVersioning to calculate versions
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
global-json-file: global.json
- name: Pack solution
run: dotnet pack SharpLearning.sln -c Release --output ${{ env.NuGetDirectory }}
- name: Add local package source
run: dotnet nuget add source ${{ env.NuGetDirectory }} --name local
- name: Get version of dll
run: (Get-Item './build/SharpLearning.AdaBoost_AnyCPU_Release_netstandard2.0/SharpLearning.AdaBoost.dll').VersionInfo.ProductVersion # unified version, so use AdaBoost dll.
- uses: actions/upload-artifact@v4
with:
name: nuget
if-no-files-found: error
retention-days: 7
path: ${{ env.NuGetDirectory }}/*nupkg

create-release-push:
needs: [ build, pack ]
runs-on: windows-latest
permissions:
contents: write
if: ${{ github.event.inputs.version != '' && github.actor == 'mdabros'}}

steps:
- uses: actions/checkout@v3
- name: Download nuget packages
uses: actions/download-artifact@v4
with:
name: nuget
path: ${{ env.NuGetDirectory }}
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.ACTION_GITHUB_TOKEN }}
with:
tag_name: v${{ github.event.inputs.version }}
release_name: ${{ github.event.inputs.version }}
draft: true
- name: Create tag (for release)
run: |
git tag v${{ github.event.inputs.version }}
git push origin v${{ github.event.inputs.version }}
- name: Upload NuGet packages
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.ACTION_GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.NuGetDirectory }}/*.nupkg
asset_name: ${{ env.NuGetDirectory }}/*.nupkg
asset_content_type: application/zip
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
global-json-file: global.json
- name: Push NuGet packages
run: |
for package in ${{ env.NuGetDirectory }}/*.nupkg; do
dotnet nuget push "$package" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
done
1 change: 1 addition & 0 deletions SharpLearning.sln
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "root", "root", "{D83436F7-2
global.json = global.json
LICENSE = LICENSE
README.md = README.md
version.json = version.json
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{2204FA16-973A-48CF-A9FD-94FA72424BA4}"
Expand Down
4 changes: 0 additions & 4 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<Project>
<PropertyGroup>
<AssemblyVersion>0.31.0</AssemblyVersion>
<FileVersion>0.31.10</FileVersion>
<InformationalVersion>$(FileVersion)</InformationalVersion>
<PackageVersion>$(InformationalVersion)</PackageVersion>
<!--https://github.com/dotnet/sourcelink/blob/main/docs/README.md#includesourcerevisionininformationalversion-->
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>

Expand Down
7 changes: 7 additions & 0 deletions src/SharpLearning.AdaBoost/SharpLearning.AdaBoost.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,11 @@
<ProjectReference Include="..\SharpLearning.Metrics\SharpLearning.Metrics.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.139">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,11 @@
<ProjectReference Include="..\SharpLearning.Containers\SharpLearning.Containers.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.139">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
7 changes: 7 additions & 0 deletions src/SharpLearning.Containers/SharpLearning.Containers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,11 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.139">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,11 @@
<ProjectReference Include="..\SharpLearning.InputOutput\SharpLearning.InputOutput.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.139">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,11 @@
<ProjectReference Include="..\SharpLearning.InputOutput\SharpLearning.InputOutput.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.139">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
7 changes: 7 additions & 0 deletions src/SharpLearning.Ensemble/SharpLearning.Ensemble.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,11 @@
<ProjectReference Include="..\SharpLearning.Metrics\SharpLearning.Metrics.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.139">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,11 @@
<ProjectReference Include="..\SharpLearning.InputOutput\SharpLearning.InputOutput.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.139">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,11 @@
<ProjectReference Include="..\SharpLearning.InputOutput\SharpLearning.InputOutput.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.139">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,11 @@
<ProjectReference Include="..\SharpLearning.Containers\SharpLearning.Containers.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.139">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
7 changes: 7 additions & 0 deletions src/SharpLearning.Metrics/SharpLearning.Metrics.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,11 @@
<ProjectReference Include="..\SharpLearning.Containers\SharpLearning.Containers.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.139">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
14 changes: 9 additions & 5 deletions src/SharpLearning.Neural/SharpLearning.Neural.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@
<PackageTags>neural network convolutional deep learning machine-learning classification regression</PackageTags>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MathNet.Numerics" Version="4.8.1" />
<PackageReference Include="MathNet.Numerics.MKL.Win" Version="2.3.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\SharpLearning.Common.Interfaces\SharpLearning.Common.Interfaces.csproj" />
<ProjectReference Include="..\SharpLearning.Containers\SharpLearning.Containers.csproj" />
<ProjectReference Include="..\SharpLearning.InputOutput\SharpLearning.InputOutput.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.139">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="MathNet.Numerics" Version="4.8.1" />
<PackageReference Include="MathNet.Numerics.MKL.Win" Version="2.3.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ public void GlobalizedBoundedNelderMeadOptimizer_OptimizeBest(int? maxDegreeOfPa
Assert.AreEqual(expected: -0.99999960731425908, actual.Error, Delta);
Assert.AreEqual(expected: 3, actual.ParameterSet.Length);

Assert.AreEqual(expected: -1.5711056814954487, actual.ParameterSet[0], Delta);
Assert.AreEqual(expected: -6.283490634742785, actual.ParameterSet[1], Delta);
Assert.AreEqual(expected: -2.9822323517533149E-07, actual.ParameterSet[2], Delta);
const double delta = 1e-3;
Assert.AreEqual(expected: -1.5711056814954487, actual.ParameterSet[0], delta);
Assert.AreEqual(expected: -6.283490634742785, actual.ParameterSet[1], delta);
Assert.AreEqual(expected: -2.9822323517533149E-07, actual.ParameterSet[2], delta);
}

[TestMethod]
Expand Down
11 changes: 7 additions & 4 deletions src/SharpLearning.Optimization/SharpLearning.Optimization.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@
<PackageTags>optimization grid search random particle swarm nelder-mead bayesian-optimization machine-learning</PackageTags>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\SharpLearning.Common.Interfaces\SharpLearning.Common.Interfaces.csproj" />
<ProjectReference Include="..\SharpLearning.Containers\SharpLearning.Containers.csproj" />
<ProjectReference Include="..\SharpLearning.RandomForest\SharpLearning.RandomForest.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.139">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,11 @@
<ProjectReference Include="..\SharpLearning.InputOutput\SharpLearning.InputOutput.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.139">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
12 changes: 8 additions & 4 deletions src/SharpLearning.XGBoost/SharpLearning.XGBoost.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@
<NoWarn>$(NoWarn);NU1701;MSB3270</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="PicNet.XGBoost" Version="0.2.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\SharpLearning.Common.Interfaces\SharpLearning.Common.Interfaces.csproj" />
<ProjectReference Include="..\SharpLearning.Containers\SharpLearning.Containers.csproj" />
<ProjectReference Include="..\SharpLearning.GradientBoost\SharpLearning.GradientBoost.csproj" />
<ProjectReference Include="..\SharpLearning.InputOutput\SharpLearning.InputOutput.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.139">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="PicNet.XGBoost" Version="0.2.1" />
</ItemGroup>

</Project>
13 changes: 13 additions & 0 deletions version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json",
"version": "0.40",
"publicReleaseRefSpec": [
"^refs/heads/master",
"^refs/heads/v\\d+(?:\\.\\d+)?$"
],
"cloudBuild": {
"buildNumber": {
"enabled": false
}
}
}