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

Got CI/CD setup to sycn, version, build, test, and publish the library to nuget.org #1

Merged
merged 19 commits into from
Sep 12, 2023
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
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"gitversion.tool": {
"version": "5.12.0",
"commands": [
"dotnet-gitversion"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ jobs:
node-version: 18
cache: yarn
cache-dependency-path: ./docusaurus/yarn.lock


- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build website
Expand Down
36 changes: 0 additions & 36 deletions .github/workflows/dotnet-desktop.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/publish_package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: .NET Core Desktop

on: [ push, pull_request ]
#branches: [ "main" ]
# pull_request:
# branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
env:
SourceDir: ./src/
Configuration: Release
Solution_Path: ./src/Extended.Collections.sln
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Restore Dotnet Tools
run: dotnet tool restore
- name: Run Git Version
run: |
dotnet gitversion
echo Semantic Version: ${GitVersion_SemVer}
- name: Build
run: dotnet build ${Solution_Path}
- name: Execute unit tests
run: dotnet test ${Solution_Path}
- name: Pack
run: dotnet msbuild -t:pack ${Solution_Path}
- name: Push
run: dotnet nuget push ./src/Extended.Collections/bin/${Configuration}/*.nupkg --api-key ${{ secrets.NuGet_Api_Key }} --source ${{ vars.Nuget_Source_Url}}
37 changes: 2 additions & 35 deletions documentation/generic/ring_buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,6 @@
A ring buffer is a data structure that efficiently manages a fixed-size, cyclically-referenced buffer, allowing for constant-time insertions and removals while overwriting the oldest data when full.


```csharp title=RingBufferSandbox.cs
using Extended.Collections.Generic;

namespace Extended.Collections.Playground.Generic
{
public class RingBufferSandbox : Sandbox
{
private readonly RingBuffer<string> m_buffer;

public RingBufferSandbox()
{
m_buffer = new RingBuffer<string>(3);
}

protected override void Run()
{
m_buffer.Add("A");
m_buffer.Add("B");
m_buffer.Add("C");
Logger.Information("1. {Buffer}", m_buffer); // 1. [ "A", "B", "C" ]

m_buffer.Add("D");
Logger.Information("2. {Buffer}", m_buffer); // 2. [ "B", "C", "D" ]

m_buffer.Remove("C");
Logger.Information("3. {Buffer}", m_buffer); // 3. [ "B", "D" ]

m_buffer.Add("E");
Logger.Information("4. {Buffer}", m_buffer); // 4. [ "B", "D", "E" ]

m_buffer.Clear();
Logger.Information("5. {Buffer}", m_buffer); // [ ]
}
}
}
```csharp file=../../src/Extended.Collections.Playground\Generic\RingBufferSandbox.cs#L2-
// Imported
```
2 changes: 2 additions & 0 deletions documentation/generic/specialized/_category_.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
label: 'Specialized'
position: 1
25 changes: 2 additions & 23 deletions documentation/generic/specialized/ordered_dictionary.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,7 @@ Cons:

### Hypothetical Use Case:
Suppose you are building a task management application, and you need to maintain a list of tasks for a project while preserving the order in which they were added. An OrderedDictionary can be useful in this scenario to store and manage tasks associated with a project.
```cs
using System;
using System.Collections.Specialized;

class Program
{
static void Main()
{
// Create an OrderedDictionary to store tasks for a project.
OrderedDictionary<string, string> projectTasks = new OrderedDictionary<string, string>();

// Add tasks to the project in a specific order.
projectTasks.Add("Task1", "Complete research");
projectTasks.Add("Task2", "Write documentation");
projectTasks.Add("Task3", "Test functionality");

// Access tasks by their keys while maintaining their order.
Console.WriteLine("Project Tasks:");
foreach (DictionaryEntry entry in projectTasks)
{
Console.WriteLine($"{entry.Key}: {entry.Value}");
}
}
}
```csharp file=../../../src/Extended.Collections.Playground\Generic\Specialized\OrderedDictionarySandbox.cs#L2-
// Imported
```
6 changes: 6 additions & 0 deletions docusaurus/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @ts-check
const path = require('path')
const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/oceanicNext');

Expand Down Expand Up @@ -43,6 +44,11 @@ const config = {
breadcrumbs: true,
routeBasePath: '/',
showLastUpdateTime: true,
remarkPlugins: [
[require('remark-code-import'), {
removeRedundantIndentations: true,
}]
],
editUrl: ({docPath}) =>
`https://github.com/ByronMayne/Extended.Collections/edit/main/documentation/${docPath}`,

Expand Down
4 changes: 3 additions & 1 deletion docusaurus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
"clsx": "^1.2.1",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"react-dom": "^17.0.2",
"remark-code-import": "0.4.0",
"remark-jargon": "^2.22.2"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.4.1",
Expand Down
56 changes: 55 additions & 1 deletion docusaurus/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6338,6 +6338,14 @@ relateurl@^0.2.7:
resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9"
integrity sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==

[email protected]:
version "0.4.0"
resolved "https://registry.yarnpkg.com/remark-code-import/-/remark-code-import-0.4.0.tgz#94cbfe74087c55a84e65f0a972c0977cac8fc7f6"
integrity sha512-3UHRIfr7+kRBGOy6Bzp4c1dl8BLCLv+saBTAgW4+lPfs56vV6yBhO038i6MJTEoyXX1zli7l8tMGIHbYANdtZg==
dependencies:
to-gatsby-remark-plugin "^0.1.0"
unist-util-visit "^2.0.1"

remark-emoji@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/remark-emoji/-/remark-emoji-2.2.0.tgz#1c702090a1525da5b80e15a8f963ef2c8236cac7"
Expand All @@ -6352,6 +6360,13 @@ [email protected]:
resolved "https://registry.yarnpkg.com/remark-footnotes/-/remark-footnotes-2.0.0.tgz#9001c4c2ffebba55695d2dd80ffb8b82f7e6303f"
integrity sha512-3Clt8ZMH75Ayjp9q4CorNeyjwIxHFcTkaektplKGl2A1jNGEUey8cKL0ZC5vJwfcD5GFGsNLImLG/NGzWIzoMQ==

remark-jargon@^2.22.2:
version "2.22.2"
resolved "https://registry.yarnpkg.com/remark-jargon/-/remark-jargon-2.22.2.tgz#d81cefe6ecd419488c7ac1936add4c6d9e958ea0"
integrity sha512-TRQozoCzaOt9dNlgdffWVujZP5FRO+SSDHAUDVqYZi110J7HbcCiYTvIOJdwH2roMtQGd0bnGWibDyRCjeXlZA==
dependencies:
unist-util-visit "^4.1.0"

[email protected]:
version "1.6.22"
resolved "https://registry.yarnpkg.com/remark-mdx/-/remark-mdx-1.6.22.tgz#06a8dab07dcfdd57f3373af7f86bd0e992108bbd"
Expand Down Expand Up @@ -7056,6 +7071,13 @@ to-fast-properties@^2.0.0:
resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e"
integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==

to-gatsby-remark-plugin@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/to-gatsby-remark-plugin/-/to-gatsby-remark-plugin-0.1.0.tgz#34167b2c3cf3209745cf97e5a488042586f9990d"
integrity sha512-blmhJ/gIrytWnWLgPSRCkhCPeki6UBK2daa3k9mGahN7GjwHu8KrS7F70MvwlsG7IE794JLgwAdCbi4hU4faFQ==
dependencies:
to-vfile "^6.1.0"

to-readable-stream@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-1.0.0.tgz#ce0aa0c2f3df6adf852efb404a783e77c0475771"
Expand All @@ -7068,6 +7090,14 @@ to-regex-range@^5.0.1:
dependencies:
is-number "^7.0.0"

to-vfile@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/to-vfile/-/to-vfile-6.1.0.tgz#5f7a3f65813c2c4e34ee1f7643a5646344627699"
integrity sha512-BxX8EkCxOAZe+D/ToHdDsJcVI4HqQfmw0tCkp31zf3dNP/XWIAjU4CmeuSwsSoOzOTqHPOL0KUzyZqJplkD0Qw==
dependencies:
is-buffer "^2.0.0"
vfile "^4.0.0"

[email protected]:
version "1.0.1"
resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35"
Expand Down Expand Up @@ -7215,6 +7245,13 @@ unist-util-is@^4.0.0:
resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-4.1.0.tgz#976e5f462a7a5de73d94b706bac1b90671b57797"
integrity sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==

unist-util-is@^5.0.0:
version "5.2.1"
resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-5.2.1.tgz#b74960e145c18dcb6226bc57933597f5486deae9"
integrity sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==
dependencies:
"@types/unist" "^2.0.0"

unist-util-position@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/unist-util-position/-/unist-util-position-3.1.0.tgz#1c42ee6301f8d52f47d14f62bbdb796571fa2d47"
Expand Down Expand Up @@ -7249,7 +7286,15 @@ unist-util-visit-parents@^3.0.0:
"@types/unist" "^2.0.0"
unist-util-is "^4.0.0"

[email protected], unist-util-visit@^2.0.0, unist-util-visit@^2.0.3:
unist-util-visit-parents@^5.1.1:
version "5.1.3"
resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz#b4520811b0ca34285633785045df7a8d6776cfeb"
integrity sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==
dependencies:
"@types/unist" "^2.0.0"
unist-util-is "^5.0.0"

[email protected], unist-util-visit@^2.0.0, unist-util-visit@^2.0.1, unist-util-visit@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-2.0.3.tgz#c3703893146df47203bb8a9795af47d7b971208c"
integrity sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==
Expand All @@ -7258,6 +7303,15 @@ [email protected], unist-util-visit@^2.0.0, unist-util-visit@^2.0.3:
unist-util-is "^4.0.0"
unist-util-visit-parents "^3.0.0"

unist-util-visit@^4.1.0:
version "4.1.2"
resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-4.1.2.tgz#125a42d1eb876283715a3cb5cceaa531828c72e2"
integrity sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==
dependencies:
"@types/unist" "^2.0.0"
unist-util-is "^5.0.0"
unist-util-visit-parents "^5.1.1"

universalify@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Serilog" Version="3.0.2-dev-02044" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.2.0-dev-00918" />
<PackageReference Include="Serilog" Version="3.0.1" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
45 changes: 19 additions & 26 deletions src/Extended.Collections.Playground/Generic/RingBufferSandbox.cs
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
using Extended.Collections.Generic;
namespace Extended.Collections.Playground.Generic;
using Extended.Collections.Generic;

namespace Extended.Collections.Playground.Generic
public class RingBufferSandbox : Sandbox
{
public class RingBufferSandbox : Sandbox
{
private readonly RingBuffer<string> m_buffer;

public RingBufferSandbox()
{
m_buffer = new RingBuffer<string>(3);
}
private readonly RingBuffer<string> m_buffer = new (3);

protected override void Run()
{
m_buffer.Add("A");
m_buffer.Add("B");
m_buffer.Add("C");
Logger.Information("1. {Buffer}", m_buffer); // 1. [ "A", "B", "C" ]
protected override void Run()
{
m_buffer.Add("A");
m_buffer.Add("B");
m_buffer.Add("C");
Logger.Information("1. {Buffer}", m_buffer); // 1. [ "A", "B", "C" ]

m_buffer.Add("D");
Logger.Information("2. {Buffer}", m_buffer); // 2. [ "B", "C", "D" ]
m_buffer.Add("D");
Logger.Information("2. {Buffer}", m_buffer); // 2. [ "B", "C", "D" ]

m_buffer.Remove("C");
Logger.Information("3. {Buffer}", m_buffer); // 3. [ "B", "D" ]
m_buffer.Remove("C");
Logger.Information("3. {Buffer}", m_buffer); // 3. [ "B", "D" ]

m_buffer.Add("E");
Logger.Information("4. {Buffer}", m_buffer); // 4. [ "B", "D", "E" ]
m_buffer.Add("E");
Logger.Information("4. {Buffer}", m_buffer); // 4. [ "B", "D", "E" ]

m_buffer.Clear();
Logger.Information("5. {Buffer}", m_buffer); // [ ]
}
m_buffer.Clear();
Logger.Information("5. {Buffer}", m_buffer); // [ ]
}
}
}
Loading
Loading