Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.1.0 release #96

Merged
merged 36 commits into from
Jul 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3c30889
Bump actions/checkout from 2 to 3
dependabot[bot] Mar 2, 2022
f9e7ab1
Adds support for generating test data into a db directly to BadMedici…
tznind Mar 30, 2022
af7c4f5
Updated changelog and documentation to indicate how to generate into …
tznind Mar 30, 2022
3b59861
Merge pull request #86 from HicServices/to-db
jas88 Mar 30, 2022
2e7ed28
Merge pull request #83 from HicServices/dependabot/github_actions/act…
jas88 Mar 30, 2022
5c4a909
.Net 6, tidied CI
jas88 Mar 30, 2022
689b3c5
Fix output paths
jas88 Mar 30, 2022
2a6c1e0
Merge branch 'develop' into feature/net6
jas88 Mar 30, 2022
6a8b00a
Merge pull request #87 from HicServices/feature/net6
tznind Mar 30, 2022
4d3ad57
Update LGTM .Net SDK version
jas88 Mar 30, 2022
e8d6748
Bump actions/setup-dotnet from 1 to 2
dependabot[bot] Mar 31, 2022
1d59f1d
Bump MathNet.Numerics from 4.15.0 to 5.0.0
dependabot[bot] Apr 4, 2022
d7673cf
Merge pull request #89 from HicServices/dependabot/nuget/develop/Math…
jas88 Apr 4, 2022
d8736a7
Bump HIC.FAnsiSql from 2.0.3 to 2.0.4
dependabot[bot] Apr 22, 2022
6a69b00
Merge pull request #90 from HicServices/dependabot/nuget/develop/HIC.…
jas88 Apr 22, 2022
a44e324
Bump Microsoft.NET.Test.Sdk from 17.1.0 to 17.2.0
dependabot[bot] May 12, 2022
e98708b
Merge pull request #91 from HicServices/dependabot/nuget/develop/Micr…
jas88 May 12, 2022
5aa538b
Added Wide and UltraWide test datasets
tznind May 12, 2022
d2af606
Moved Wide/UltraWide docs to Datasets.doc.xml
tznind May 12, 2022
18c962f
Tidy chain of ifs to a switch
jas88 May 12, 2022
1d79084
Merge pull request #88 from HicServices/dependabot/github_actions/act…
jas88 May 12, 2022
78fef8b
Merge pull request #92 from HicServices/wide
jas88 May 12, 2022
269c167
Bump CommandLineParser from 2.8.0 to 2.9.1
dependabot[bot] May 18, 2022
ac92181
Merge pull request #93 from HicServices/dependabot/nuget/develop/Comm…
jas88 May 18, 2022
27f9eb8
Bump svenstaro/upload-release-action from 2.2.1 to 2.3.0
dependabot[bot] Jun 6, 2022
d359b7c
Bump CsvHelper from 27.2.1 to 28.0.0
dependabot[bot] Jul 11, 2022
5d172ff
Merge pull request #95 from HicServices/dependabot/nuget/develop/CsvH…
jas88 Jul 11, 2022
ede0787
Merge pull request #94 from HicServices/dependabot/github_actions/sve…
jas88 Jul 11, 2022
c6c42d4
Update dependabot.yml
jas88 Jul 11, 2022
c9569dc
Update version to 1.1.0
jas88 Jul 11, 2022
9af9a3a
Embed PDB, skip XML for CLI tool
jas88 Jul 11, 2022
863e848
Merge branch 'develop' of github.com:HicServices/BadMedicine into dev…
jas88 Jul 11, 2022
5870574
Skip XML in generated CLI tool
jas88 Jul 11, 2022
8dc2d19
Add Sourcelink to nupkg
jas88 Jul 11, 2022
4777df8
Note addition of Sourcelink
jas88 Jul 11, 2022
7b8ec5e
Add Sourcelink to Packages.md
jas88 Jul 11, 2022
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
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
target-branch: develop
schedule:
# Check for updates to GitHub Actions every weekday
interval: "daily"
Expand Down
25 changes: 17 additions & 8 deletions .github/workflows/testpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,30 @@ jobs:
package:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0.x'
- name: Test
run: dotnet test --nologo
- name: Package
run: |
(cd BadMedicine.Core && dotnet pack -p:PackageVersion=$(fgrep AssemblyInformationalVersion ../SharedAssemblyInfo.cs|cut -d'"' -f2) -o . --include-source --include-symbols --nologo -c Release)
(cd BadMedicine && dotnet publish --nologo --runtime win-x64 -c Release --self-contained true -o ../win-x64)
(cd BadMedicine && dotnet publish --nologo --runtime linux-x64 -c Release --self-contained true -o ../linux-x64)
(cd win-x64 && zip -9r ../badmedicine-cli-win-x64.zip .)
(tar czf badmedicine-cli-linux-x64.tgz ./linux-x64)
dotnet publish BadMedicine/BadMedicine.csproj -o linux-x64 -r linux-x64 -c Release --self-contained --nologo -p:PublishSingleFile=true -p:GenerateDocumentationFile=false
dotnet publish BadMedicine/BadMedicine.csproj -o win-x64 -r win-x64 -c Release --self-contained --nologo -p:PublishSingleFile=true -p:GenerateDocumentationFile=false
dotnet pack BadMedicine.Core/BadMedicine.Core.csproj -p:PackageVersion=$(fgrep AssemblyInformationalVersion SharedAssemblyInfo.cs|cut -d'"' -f2) -o . --include-source --include-symbols --nologo -c Release
tar czf badmedicine-cli-linux-x64.tgz ./linux-x64
zip -9rj badmedicine-cli-win-x64.zip win-x64
- name: Nuget push
if: contains(github.ref,'refs/tags/')
run: (cd BadMedicine.Core && nuget push HIC.*.nupkg -skipDuplicate -Source https://api.nuget.org/v3/index.json -ApiKey ${{ secrets.NUGET_KEY }})
run: nuget push HIC.*.nupkg -skipDuplicate -Source https://api.nuget.org/v3/index.json -ApiKey ${{ secrets.NUGET_KEY }}
- name: Upload release binaries
uses: svenstaro/upload-release-action@2.2.1
uses: svenstaro/upload-release-action@2.3.0
if: contains(github.ref, 'refs/tags/v')
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 4 additions & 2 deletions BadMedicine.Core/BadMedicine.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<ApplicationIcon />
<OutputType>Library</OutputType>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<DebugType>embedded</DebugType>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<RootNamespace>BadMedicine</RootNamespace>
<AssemblyName>BadMedicine.Core</AssemblyName>
Expand Down Expand Up @@ -48,8 +49,9 @@ BadMedicine differs from other random data generators e.g. Mockaroo, SQL Data Ge
<EmbeddedResource Include="Datasets\Maternity.csv" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CsvHelper" Version="27.2.1" />
<PackageReference Include="MathNet.Numerics" Version="4.15.0" />
<PackageReference Include="CsvHelper" Version="28.0.0" />
<PackageReference Include="MathNet.Numerics" Version="5.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
Expand Down
55 changes: 55 additions & 0 deletions BadMedicine.Core/Datasets/UltraWide.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using System;
using System.Threading;

namespace BadMedicine.Datasets
{
/// <include file='../../Datasets.doc.xml' path='Datasets/UltraWide'/>
public class UltraWide : DataGenerator
{
int autonum = 1;

/// <inheritdoc/>
public UltraWide(Random rand) : base(rand)
{
}

/// <inheritdoc/>
public override object[] GenerateTestDataRow(Person p)
{
r.Next();

var array = new object[20_000];
array[0] = Interlocked.Increment(ref autonum);
array[1] = p.CHI;

for (var i = 2; i < array.Length; i++)
{
array[i] = i switch
{
< 4_000 => r.Next(),
< 8_000 => r.NextDouble(),
< 16_000 => GetRandomSentence(r),
< 19_500 => GetRandomGPCode(r),
_ => GetGaussianInt(50, 50000)
};
}

return array;
}

/// <inheritdoc/>
protected override string[] GetHeaders()
{
var array = new string[20_000];
array[0] = "id";
array[1] = "chi";

for (var i = 2; i < array.Length; i++)
{
array[i] = $"col{i}";
}

return array;
}
}
}
55 changes: 55 additions & 0 deletions BadMedicine.Core/Datasets/Wide.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using System;
using System.Threading;

namespace BadMedicine.Datasets
{
/// <include file='../../Datasets.doc.xml' path='Datasets/Wide'/>
public class Wide : DataGenerator
{
int autonum = 1;

/// <inheritdoc/>
public Wide(Random rand) : base(rand)
{
}

/// <inheritdoc/>
public override object[] GenerateTestDataRow(Person p)
{
r.Next();

var array = new object[980];
array[0] = Interlocked.Increment(ref autonum);
array[1] = p.CHI;

for (var i = 2; i < array.Length; i++)
{
array[i] = i switch
{
< 100 => r.Next(),
< 200 => r.NextDouble(),
< 300 => GetRandomSentence(r),
< 400 => GetRandomGPCode(r),
_ => GetGaussianInt(50, 50000)
};
}

return array;
}

/// <inheritdoc/>
protected override string[] GetHeaders()
{
var array = new string[980];
array[0] = "id";
array[1] = "chi";

for (var i = 2; i < array.Length; i++)
{
array[i] = $"col{i}";
}

return array;
}
}
}
17 changes: 14 additions & 3 deletions BadMedicine/BadMedicine.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>

<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<StartupObject></StartupObject>
<ApplicationIcon />
<OutputType>Exe</OutputType>
<StartupObject>BadMedicine.Program</StartupObject>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<DebugType>embedded</DebugType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
</PropertyGroup>
Expand All @@ -19,11 +20,21 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<None Remove="BadMedicine.template.yaml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\SharedAssemblyInfo.cs" Link="SharedAssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.8.0" />
<Content Include="BadMedicine.template.yaml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="HIC.FAnsiSql" Version="2.0.4" />
<PackageReference Include="YamlDotNet" Version="11.2.1" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
Expand Down
9 changes: 9 additions & 0 deletions BadMedicine/BadMedicine.template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Database:
# Set to true to drop and recreate tables described in the Template
DropTables: false
# The connection string to your database
ConnectionString: server=127.0.0.1;Uid=root;Pwd=root;SslMode=None;AllowPublicKeyRetrieval=True
# Your DBMS provider ('MySql', 'PostgreSql','Oracle' or 'MicrosoftSQLServer')
DatabaseType: MySql
# Database to create/use on the server
DatabaseName: BadMedicineTestData
7 changes: 7 additions & 0 deletions BadMedicine/Configuration/Config.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace BadMedicine.Configuration
{
class Config
{
public TargetDatabase Database { get;set; }
}
}
30 changes: 30 additions & 0 deletions BadMedicine/Configuration/TargetDatabase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using FAnsi;

namespace BadMedicine.Configuration
{
/// <summary>
/// Identify the target database and configuration for generated data
/// </summary>
public class TargetDatabase
{
/// <summary>
/// Which RDBMS the database is (MySQL, Microsoft SQL Server, etc)
/// </summary>
public DatabaseType DatabaseType { get; set; }
/// <summary>
/// The ConnectionString containing the server name, credentials and other parameters for the connection
/// </summary>
public string ConnectionString { get; set; }

/// <summary>
/// The name of database
/// </summary>
public string DatabaseName { get; set; }

/// <summary>
/// Set to true to drop and recreate tables described in the Template
/// </summary>
public bool DropTables { get; set; }

}
}
Loading