Skip to content
Open
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
6 changes: 3 additions & 3 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
"isRoot": true,
"tools": {
"csharpier": {
"version": "1.1.2",
"version": "1.2.6",
"commands": [
"csharpier"
],
"rollForward": false
},
"dotnet-outdated-tool": {
"version": "4.6.8",
"version": "4.7.1",
"commands": [
"dotnet-outdated"
],
"rollForward": false
},
"husky": {
"version": "0.7.2",
"version": "0.9.1",
"commands": [
"husky"
],
Expand Down
File renamed without changes.
598 changes: 597 additions & 1 deletion .editorconfig

Large diffs are not rendered by default.

65 changes: 48 additions & 17 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,26 +1,57 @@
###############################################################################
# Git Attributes
#
# Normalize text files to LF in the repository. Git will handle conversion
# during checkout as needed, while .editorconfig controls the editor behavior.
###############################################################################
# Set default behavior to automatically normalize line endings.

* text=auto eol=lf

###############################################################################
* text=auto
# Language-specific diff drivers
###############################################################################

*.cs diff=csharp

###############################################################################
# Set default behavior for command prompt diff.
# Merge behavior
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
# Prevent Git from inserting conflict markers into Visual Studio solution and
# project files. These files require manual conflict resolution.
###############################################################################

*.sln merge=binary
*.csproj merge=binary

###############################################################################
# Linux / Cross-platform files
###############################################################################
*.cs diff=csharp

*.bash text eol=lf
*.editorconfig text eol=lf
*.sh text eol=lf

*.json text eol=lf
*.jsonc text eol=lf
*.md text eol=lf
*.xml text eol=lf
*.yaml text eol=lf
*.yml text eol=lf

Dockerfile text eol=lf

###############################################################################
# Set the merge driver for project and solution files
# Windows-native files
###############################################################################

*.bat text eol=crlf
*.cmd text eol=crlf

###############################################################################
# PowerShell
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
*.sln merge=binary
*.csproj merge=binary
# PowerShell fully supports LF, making it the preferred choice for
# cross-platform repositories and devcontainers.
###############################################################################

*.ps1 text eol=lf
Empty file added .github/CODEOWNERS
Empty file.
12 changes: 12 additions & 0 deletions .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: "NetDuid CodeQL Configuration"

query-filters:
- exclude:
problem.severity:
- warning
- recommendation
- note

paths-ignore:
- src/NetDuid.Tests
- src/NetDuid.Benchmarks
4 changes: 0 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ updates:
day: "sunday"
allow:
- dependency-type: direct
ignore:
- dependency-name: "*"
update-types:
- "version-update:semver-patch"
commit-message:
prefix: "Dependabot package update"
open-pull-requests-limit: 5
Expand Down
89 changes: 81 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,19 @@ on:
branches: ["main"]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
env:
HUSKY: 0 # don't run husky.net hooks
HUSKY: 0 # don't run husky.net hooks

steps:
- name: Checkout code
Expand All @@ -26,22 +34,87 @@ jobs:
- name: Setup .NET SDKs
uses: actions/setup-dotnet@v5
with:
# .net 4.8.x is included by default in windows-latest
dotnet-version: |
8.0.x
9.0.x
10.0.x

- name: NuGet cache
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-

- name: Restore .NET tools
run: dotnet tool restore
working-directory: .

- name: Restore dependencies
run: dotnet restore
working-directory: ./src

- name: Build
run: dotnet build ./src --no-restore -p:VersionFromCI="0.0.0-cibuild"
run: dotnet build --no-restore --configuration Release -p:VersionFromCI="0.0.0-cibuild"

- name: Test with coverage (Ubuntu — net8.0)
if: matrix.os == 'ubuntu-latest'
run: |
dotnet tool install --global dotnet-coverage 2>/dev/null || dotnet tool update --global dotnet-coverage
dotnet-coverage collect "dotnet test --no-build --verbosity normal --logger trx --framework net8.0" -f cobertura -o coverage/cobertura-net8.xml

- name: Test
run: dotnet test ./src --no-build --verbosity normal
- name: Test with coverage (Ubuntu — net9.0)
if: matrix.os == 'ubuntu-latest'
run: |
dotnet tool install --global dotnet-coverage 2>/dev/null || dotnet tool update --global dotnet-coverage
dotnet-coverage collect "dotnet test --no-build --verbosity normal --logger trx --framework net9.0" -f cobertura -o coverage/cobertura-net9.xml

- name: Test with coverage (Ubuntu — net10.0)
if: matrix.os == 'ubuntu-latest'
run: |
dotnet tool install --global dotnet-coverage 2>/dev/null || dotnet tool update --global dotnet-coverage
dotnet-coverage collect "dotnet test --no-build --verbosity normal --logger trx --framework net10.0" -f cobertura -o coverage/cobertura.xml

- name: Test (Windows — all TFMs including net48)
if: matrix.os == 'windows-latest'
run: dotnet test --no-build --verbosity normal --logger trx

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ runner.os }}
path: '**/TestResults/*.trx'
retention-days: 30

- name: Upload coverage results
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: coverage-${{ github.sha }}
path: coverage/
retention-days: 30

coverage-report:
needs: build
if: github.event_name == 'pull_request' && needs.build.result == 'success'
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: read
steps:
- uses: actions/download-artifact@v4
with:
name: coverage-${{ github.sha }}
path: coverage/
merge-multiple: true
- name: Generate coverage badge
uses: danielpalme/ReportGenerator-GitHub-Action@v5
with:
reports: coverage/*.xml
targetdir: coveragereport
reporttypes: MarkdownSummary
- name: Post coverage summary
uses: marocchino/sticky-pull-request-comment@v2
with:
header: Code Coverage
path: coveragereport/Summary.md
50 changes: 50 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "CodeQL"

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
schedule:
- cron: '31 15 * * 2'

jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
security-events: write
packages: read
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: actions
build-mode: none
- language: csharp
build-mode: autobuild

steps:
- name: Checkout repository
uses: actions/checkout@v6

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

- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: security-extended,security-and-quality
config-file: ./.github/codeql/codeql-config.yml

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{matrix.language}}"
28 changes: 28 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Dependency Review

on:
pull_request:
branches: ["main"]

permissions:
contents: read
pull-requests: write

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Review dependencies
uses: actions/dependency-review-action@v4
continue-on-error: true
with:
fail-on-severity: high
comment-summary-in-pr: true
# Suppress "unknown license" warnings — they are false positives:
# 1) GitHub Actions don't carry SPDX metadata the tool can read
# 2) Some preview NuGet packages lack modern <license> in nuspec
# 3) The NetDuid smoke test references a placeholder version not on NuGet.org
allow-unknown-licenses: true
Loading
Loading