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
5 changes: 5 additions & 0 deletions .build/build.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
PROJECT_SOLUTION=gokstad.sln
PROJECT_TEST_SOLUTION=gokstad.tests.sln
MAJOR_VERSION=0
MINOR_VERSION=2
PROJECT_NAME=gokstad
25 changes: 25 additions & 0 deletions .build/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# *******************************
# Build script
# *******************************
solution=$1 # solution name: my-solution.sln
major=$2 # major version: 1
minor=$3 # minor version: 0

#
# revision and build are: twoDigitYear-dayOfYear.hour-minute
# - this provides uniqueness to the minute for each assembly
# - eg: build version :: 1.0.240713.0116 -> 2024 July 13, 1:16AM
#
year="$(date '+%Y')"
revision=${year:2:2}"$(date '+%j')"
build="$(date '+%H%M')"

# build the version number -
version=$major.$minor.$revision.$build
echo "build version :: " $version

#
# build and tag the version number
# - alternate - /p:Version=
dotnet clean $solution
dotnet build $solution --configuration Debug -p:Version=$version
28 changes: 28 additions & 0 deletions .build/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# *******************************
# Build script
# *******************************
solution=$1 # solution name: my-solution.sln
major=$2 # major version: 1
minor=$3 # minor version: 0

#
# revision and build are: twoDigitYear-dayOfYear.hour-minute
# - this provides uniqueness to the minute for each assembly
# - eg: build version :: 1.0.240713.0116 -> 2024 July 13, 1:16AM
#
year="$(date '+%Y')"
revision=${year:2:2}"$(date '+%j')"
build="$(date '+%H%M')"

# build the version number -
version=$major.$minor.$revision.$build
echo "build version :: " $version

# ****************************************
# Publishing as self-contained
# Packages dotnet with the application
#
# container flags: --os linux --arch x64 /t:PublishContainer
# rids: linux-x64, linux-arm64, osx-x64, osx-arm64, win-x64, win-arm64
# https://learn.microsoft.com/en-us/dotnet/core/rid-catalog
dotnet publish $solution --framework net8.0 --configuration Release --self-contained true -r linux-x64 -p:Version=$version
9 changes: 9 additions & 0 deletions .build/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# $1 expects test soltion name: ir-loader.tests.sln
#
dotnet tool install -g dotnet-reportgenerator-globaltool
if [[ ":$PATH:" != *":$HOME/.dotnet/tools:"* ]]; then
export PATH="$PATH:$HOME/.dotnet/tools"
fi
dotnet test $1 --collect:"XPlat Code Coverage" --test-adapter-path:. --logger:"junit;LogFilePath=..\artifacts\{assembly}-test-result.xml;MethodFormat=Class;FailureBodyFormat=Verbose"
reportgenerator -reports:./**/TestResults/**/coverage.cobertura.xml -targetdir:coverage-reports -reporttypes:Html
11 changes: 11 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"hooks": {},
"permissions": {
"allow": [
"Bash(dotnet build *)",
"Bash(dotnet test *)",
"Bash(dotnet format *)",
"Bash(dotnet restore *)"
]
}
}
20 changes: 20 additions & 0 deletions .deploy/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
WORKDIR /app
# NuGet sources (e.g. GitHub Packages) are added at runtime via environment
# or a mounted nuget.config — do not embed credentials here.

# Copy everything and restore as distinct layers
COPY . ./
RUN dotnet restore gokstad.sln

# publish
COPY . ./
RUN dotnet publish gokstad.sln -c Release -o out

# Build runtime image
FROM mcr.microsoft.com/dotnet/runtime:8.0.3-alpine3.19-amd64
WORKDIR /app
RUN apk add --no-cache icu-libs
RUN apk add --no-cache icu-data-full
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "gokstad.dll"]
20 changes: 20 additions & 0 deletions .deploy/docker-compose.debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

version: '3.4'

services:
app:
container_name: gokstad
image: gokstad:latest
networks:
- app-network
build:
context: .
dockerfile: Dockerfile
args:
- configuration=Debug
volumes:
- ~/.vsdbg:/remote_debugger:rw

networks:
app-network:

9 changes: 9 additions & 0 deletions .deploy/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

version: '3.4'

services:
app:
image: gokstad
build:
context: .
dockerfile: Dockerfile
2 changes: 2 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM mcr.microsoft.com/devcontainers/dotnet:1-8.0

33 changes: 33 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet-mssql
{
"name": "dotnet 8 container",
"dockerComposeFile": "docker-compose.yml",
"service": "devcontainer",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-dotnettools.csdevkit",
"k--kato.docomment",
"ms-dotnettools.csharp",
"mhutchie.git-graph",
"donjayamanne.githistory",
"tomoki1207.pdf",
"mechatroner.rainbow-csv",
"GitHub.vscode-pull-request-github",
"ms-azuretools.vscode-docker"
]
}
}

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
13 changes: 13 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3'

services:
devcontainer:
build:
context: .
dockerfile: Dockerfile

volumes:
- ../..:/workspaces:cached

# Overrides default command so things don't shut down after the process ends.
command: sleep infinity
57 changes: 57 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
root = true

[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.cs]
indent_size = 4
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = false

# Naming: interfaces use I prefix
dotnet_naming_rule.interface_should_be_prefixed_with_i.severity = suggestion
dotnet_naming_rule.interface_should_be_prefixed_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_prefixed_with_i.style = prefix_interface_with_i

dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal

dotnet_naming_style.prefix_interface_with_i.required_prefix = I
dotnet_naming_style.prefix_interface_with_i.capitalization = pascal_case

# Naming: types and members use PascalCase
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case_style

dotnet_naming_symbols.types.applicable_kinds = class, struct, enum, delegate
dotnet_naming_style.pascal_case_style.capitalization = pascal_case

# C# formatting
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_space_after_cast = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_prefer_braces = true:suggestion

[*.{csproj,props,targets}]
indent_size = 2

[*.{yml,yaml}]
indent_size = 2

[*.json]
indent_size = 2

[*.md]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Default owner for all files — required reviewer on every PR
* @aaroncorberts
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug Report
about: Report a defect or unexpected behavior
labels: bug
---

## Description

<!-- A clear description of what the bug is -->

## Steps to Reproduce

1.
2.
3.

## Expected Behavior

<!-- What you expected to happen -->

## Actual Behavior

<!-- What actually happened -->

## Environment

- Gokstad version/package:
- .NET version (`dotnet --version`):
- OS:

## Additional Context

<!-- Stack traces, logs, or anything else relevant -->
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Feature Request
about: Suggest a new capability or improvement
labels: enhancement
---

## Summary

<!-- One sentence describing the capability you want -->

## Problem / Motivation

<!-- What problem does this solve? What's the current limitation? -->

## Proposed Solution

<!-- Describe your idea. Include API sketches or examples if possible. -->

## Alternatives Considered

<!-- Other approaches you've thought about -->
19 changes: 19 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Summary

<!-- What does this PR do? Why? -->

## Changes

-
-

## Testing

- [ ] Unit tests added / updated
- [ ] Integration tests added / updated (if touching Data, DirectoryServices, or Web)
- [ ] `dotnet build gokstad.sln` passes
- [ ] `dotnet test gokstad.tests.sln` passes

## Notes

<!-- Anything reviewers should pay particular attention to -->
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: nuget
directory: /
schedule:
interval: weekly
day: monday
target-branch: main
open-pull-requests-limit: 5
commit-message:
prefix: "chore(deps)"
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CI

on:
# Run on PRs targeting main — this is the primary merge gate
pull_request:
branches: [ main ]

# Run on feature branch pushes so developers get feedback before opening a PR
push:
branches:
- 'feature/**'
- 'fix/**'
- 'chore/**'
- 'docs/**'
- 'test/**'
- 'refactor/**'

jobs:
build-and-test:
name: CI / build-and-test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

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

- name: Restore
run: dotnet restore gokstad.sln

- name: Build
run: dotnet build gokstad.sln --no-restore --configuration Release

- name: Check formatting
run: dotnet format --verify-no-changes gokstad.sln

- name: Unit Tests
run: |
dotnet test gokstad.tests.sln \
--no-build \
--configuration Release \
--filter "Category!=Integration" \
--collect:"XPlat Code Coverage" \
--logger "trx;LogFileName=test-results.trx"

- name: Upload coverage
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage
path: '**/TestResults/**/*.xml'
Loading
Loading