Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
"rollForward": false
}
}
}
}
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,4 @@ dotnet_style_qualification_for_field = false
dotnet_style_qualification_for_method = false
dotnet_style_qualification_for_property = false
dotnet_style_readonly_field = true
dotnet_style_require_accessibility_modifiers = for_non_interface_members
dotnet_style_require_accessibility_modifiers = for_non_interface_members
34 changes: 34 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@ Available VS Code tasks (use via `run_task` tool):
)]
```

3. **Spelling**: All code must pass the Code Spell Checker extension
- Configure exceptions in workspace settings if needed
- British and American spelling both accepted

4. **Markdown Quality**: Markdown files must pass Markdownlint
- Proper heading hierarchy, spacing, and formatting


### Error Handling and Logging

1. **Serilog Logging**: Use structured logging with Serilog
Expand Down Expand Up @@ -194,6 +202,9 @@ Available VS Code tasks (use via `run_task` tool):
2. **Test Organization**: Arrange-Act-Assert pattern
3. **Test Naming**: Use descriptive names with underscores separating parts
4. **Theory Tests**: Use `[Theory]` with `[InlineData]` for parameterized tests
5. **Avoid Regions**: Don't use regions in test files
6. **Logical Grouping**: Organize tests in separate files by feature or class


### Project Configuration

Expand Down Expand Up @@ -258,6 +269,19 @@ Available VS Code tasks (use via `run_task` tool):
- Build script: `Build.sh`
- Debug tools: `InstallDebugTools.sh`

## Project Structure

- `.config/` - .NET tools configuration
- `.github/` - GitHub Actions workflows and Copilot instructions
- `.husky/` - Husky.Net git hooks
- `.vscode/` - Visual Studio Code settings and launch configurations
- `Benchmarks/` - BenchmarkDotNet performance measurement project
- `CodeGen/` - Code generation utilities (internal tooling)
- `Console/` - Console/CLI application using System.CommandLine
- `Docker/` - Docker build scripts and Dockerfile
- `Library/` - Core reusable library
- `Tests/` - Unit tests using xUnit and FluentAssertions

## Best Practices

1. **Immutability**: Prefer `readonly` and `required` for fields and properties
Expand All @@ -269,6 +293,8 @@ Available VS Code tasks (use via `run_task` tool):
7. **Static Analysis**: Address all analyzer warnings - zero warnings policy
8. **Code Reviews**: All changes go through pull requests
9. **Git Versioning**: Use Nerdbank.GitVersioning for version management
10. **No Regions**: Avoid code regions - use logical file separation instead


## Editor Configuration

Expand Down Expand Up @@ -298,3 +324,11 @@ The project includes comprehensive `.editorconfig` settings that enforce:
- [.NET Runtime Coding Style](https://github.com/dotnet/runtime/blob/main/docs/coding-guidelines/coding-style.md)
- [dotnet format Documentation](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-format)
- [EditorConfig Documentation](https://editorconfig.org)
- [CSharpier Documentation](https://csharpier.com)
- [Husky.Net Documentation](https://alirezanet.github.io/Husky.Net)
- [xUnit Documentation](https://xunit.net)
- [FluentAssertions Documentation](https://fluentassertions.com)
- [BenchmarkDotNet Documentation](https://benchmarkdotnet.org)
- [System.CommandLine Documentation](https://learn.microsoft.com/en-us/dotnet/standard/commandline/)
- [Serilog Documentation](https://serilog.net)

20 changes: 0 additions & 20 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,3 @@ updates:
actions-deps:
patterns:
- "*"
Comment thread
ptr727 marked this conversation as resolved.
Resolved

# develop
- package-ecosystem: "nuget"
target-branch: "develop"
directory: "/"
schedule:
interval: "daily"
groups:
nuget-deps:
patterns:
- "*"
- package-ecosystem: "github-actions"
target-branch: "develop"
directory: "/"
schedule:
interval: "daily"
groups:
actions-deps:
patterns:
- "*"
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
name: Create date badge task
name: Build BYOB date badge task

env:
IS_MAIN_BRANCH: ${{ endsWith(github.ref, 'refs/heads/main') }}

on:
workflow_call:
workflow_dispatch:

jobs:

date-badge:
name: Create date badge
name: Build BYOB date badge job
runs-on: ubuntu-latest

steps:

- id: date
- name: Get current date step
id: date
run: |
echo "date=$(date)" >> $GITHUB_OUTPUT

- name: Build date badge
- name: Build BYOB date badge step
if: ${{ env.IS_MAIN_BRANCH == 'true' }}
uses: RubbaBoy/BYOB@v1
with:
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/build-docker-task.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
name: Build docker image task
name: Build Docker image task

env:
IS_MAIN_BRANCH: ${{ endsWith(github.ref, 'refs/heads/main') }}
DOCKER_REGISTRY: docker.io
DOCKER_TAG_PREFIX: docker.io/ptr727/projecttemplate
DOCKER_FILE: ./Docker/Ubuntu.Rolling.Dockerfile
DOCKER_FILE: ./Docker/Dockerfile

on:
workflow_call:
inputs:
# Input to control whether to push the Docker image to Docker Hub
push:
required: false
type: boolean
default: false
workflow_dispatch:

jobs:

get-version:
name: Get version information
name: Get version information job
uses: ./.github/workflows/get-version-task.yml
secrets: inherit

build-docker:
name: Build docker project
name: Build Docker image job
runs-on: ubuntu-latest
needs: [get-version]

steps:

- name: Checkout
- name: Checkout step
uses: actions/checkout@v6

- name: Setup QEMU
- name: Setup QEMU step
uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64,linux/arm64

- name: Setup Buildx
- name: Setup Buildx step
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64

- name: Login to Docker Hub
- name: Login to Docker Hub step
uses: docker/login-action@v3
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Docker build and push
- name: Docker build and push step
uses: docker/build-push-action@v6
with:
context: .
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/build-executable-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ env:
on:
workflow_call:
outputs:
# Output of the uploaded artifact id
artifact-id:
value: ${{ jobs.upload-build-artifacts.outputs.artifact-id }}
workflow_dispatch:

jobs:

get-version:
name: Get version information
name: Get version information job
uses: ./.github/workflows/get-version-task.yml
secrets: inherit

build-executable-matrix:
name: Build executable project matrix
name: Build executable project matrix job
runs-on: ubuntu-latest
needs: [get-version]
strategy:
Expand All @@ -29,15 +29,15 @@ jobs:

steps:

- name: Setup .NET SDK
- name: Setup .NET SDK step
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.x

- name: Checkout code
- name: Checkout code step
uses: actions/checkout@v6

- name: Build executable project
- name: Build executable project step
run: >-
dotnet publish ${{ env.PROJECT_FILE }}
--runtime ${{ matrix.runtime }}
Expand All @@ -50,32 +50,32 @@ jobs:
-property:InformationalVersion=${{ needs.get-version.outputs.AssemblyInformationalVersion }}
-property:PackageVersion=${{ needs.get-version.outputs.SemVer2 }}

- name: Upload matrix build artifacts
- name: Upload matrix build artifacts step
uses: actions/upload-artifact@v6
with:
name: publish-${{ matrix.runtime }}
path: ${{ runner.temp }}/publish

upload-build-artifacts:
name: Upload matrix build artifacts
name: Upload matrix build artifacts job
outputs:
artifact-id: ${{ steps.artifact-upload-step.outputs.artifact-id }}
runs-on: ubuntu-latest
needs: [ build-executable-matrix ]

steps:

- name: Download matrix build artifacts
- name: Download matrix build artifacts step
uses: actions/download-artifact@v7
with:
pattern: publish-*
merge-multiple: true
path: ${{ runner.temp }}/publish

- name: Zip build output
- name: Zip build output step
run: 7z a -t7z ${{ runner.temp }}/${{ env.PROJECT_ARTIFACT }} ${{ runner.temp }}/publish/*

- name: Upload build artifacts
- name: Upload build artifacts step
id: artifact-upload-step
uses: actions/upload-artifact@v6
with:
Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/build-library-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,41 @@ env:
on:
workflow_call:
inputs:
nuget:
# Input to control whether to push the library to NuGet.org
push:
required: false
type: boolean
default: false
outputs:
# Output of the uploaded artifact id
artifact-id:
value: ${{ jobs.build-library.outputs.artifact-id }}
workflow_dispatch:

jobs:

get-version:
name: Get version information
name: Get version information job
uses: ./.github/workflows/get-version-task.yml
secrets: inherit

build-library:
name: Build library project
name: Build library project job
runs-on: ubuntu-latest
outputs:
artifact-id: ${{ steps.artifact-upload-step.outputs.artifact-id }}
needs: [get-version]

steps:

- name: Setup .NET SDK
- name: Setup .NET SDK step
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.x

- name: Checkout code
- name: Checkout code step
uses: actions/checkout@v6

- name: Build library project
- name: Build library project step
run: >-
dotnet build ${{ env.PROJECT_FILE }}
--output ${{ runner.temp }}/publish
Expand All @@ -52,19 +53,19 @@ jobs:
-property:InformationalVersion=${{ needs.get-version.outputs.AssemblyInformationalVersion }}
-property:PackageVersion=${{ needs.get-version.outputs.SemVer2 }}

- name: Publish to NuGet.org
if: ${{ inputs.nuget }}
- name: Publish to NuGet.org step
if: ${{ inputs.push }}
run: >-
dotnet nuget push ${{ runner.temp }}/publish/*.nupkg
--source https://api.nuget.org/v3/index.json
--api-key ${{ secrets.NUGET_API_KEY }}
--skip-duplicate

- name: Zip output
- name: Zip output step
run: |
7z a -t7z ${{ runner.temp }}/${{ env.PROJECT_ARTIFACT }} ${{ runner.temp }}/publish/*

- name: Upload build artifacts
- name: Upload build artifacts step
id: artifact-upload-step
uses: actions/upload-artifact@v6
with:
Expand Down
Loading
Loading