Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 7 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
"csharpier"
],
"rollForward": false
},
"husky": {
"version": "0.9.1",
"commands": [
"husky"
],
"rollForward": false
}
}
}
67 changes: 30 additions & 37 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: .NET

on:
push:
branches: ["master"]
branches: [ "master" ]
pull_request:
branches: ["master"]
branches: [ "master" ]
merge_group:
types: [checks_requested]
types: [ checks_requested ]
release:
types:
- published
Expand All @@ -19,13 +19,14 @@ jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- name: Install tools
run: dotnet tool restore
- name: check format
Expand All @@ -34,13 +35,14 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- name: Install dependencies
run: dotnet restore Motor.NET.sln
- name: Build
Expand All @@ -50,47 +52,38 @@ jobs:
- name: Publish Bridge
run: dotnet publish --framework net9.0 -v minimal -c Release --no-restore -o ./artifacts-bridge ./src/Motor.Extensions.Hosting.Bridge/Motor.Extensions.Hosting.Bridge.csproj
- name: Upload Artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: artifacts
path: |
./artifacts/*.nupkg
./artifacts/*.snupkg
- name: Upload Artifact Bridge
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: artifacts-bridge
path: ./artifacts-bridge/*

test-net8:
test:
strategy:
matrix:
dotnet_version:
- "8.0"
- "9.0"
- "10.0"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.x
- name: Install dependencies
run: dotnet restore Motor.NET.sln
- name: Test .NET8
run: dotnet test --no-restore Motor.NET.sln --framework net8.0

test-net9:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
${{ matrix.dotnet_version }}.x
- name: Install dependencies
run: dotnet restore Motor.NET.sln
- name: Test .NET9
run: dotnet test --no-restore Motor.NET.sln --framework net9.0
- name: Test
run: dotnet test --no-restore Motor.NET.sln --framework net${{ matrix.dotnet_version }}


#code-ql:
# runs-on: ubuntu-latest
# steps:
Expand All @@ -111,17 +104,17 @@ jobs:
# uses: github/codeql-action/analyze@v1

deploy:
needs: [build, format, test-net8, test-net9]
needs: [ build, format, test ]
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- name: Download Artifact
id: download
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: artifacts
- name: Setup .NET
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.x
Expand All @@ -130,12 +123,12 @@ jobs:
run: dotnet nuget push "${{ steps.download.outputs.download-path }}/*.nupkg" --skip-duplicate --source $NUGET_FEED --api-key $NUGET_KEY

build-bridge:
needs: [build, format, test-net8, test-net9]
needs: [ build, format, test ]
runs-on: ubuntu-latest
steps:
- name: Download Artifact
id: download
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: artifacts-bridge
- name: Prepare
Expand All @@ -155,13 +148,13 @@ jobs:
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
- name: Login to Github Registry
uses: docker/login-action@v3
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push to GitHub Packages
uses: docker/build-push-action@v6
uses: docker/build-push-action@v7
with:
push: ${{ github.event_name == 'release' }}
context: "${{ steps.download.outputs.download-path }}"
Expand Down
20 changes: 20 additions & 0 deletions .husky/pre-commit
Comment thread
rngcntr marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

## husky task runner examples -------------------
## Note : for local installation use 'dotnet' prefix. e.g. 'dotnet husky'

## run all tasks
dotnet husky run

### run all tasks with group: 'group-name'
#husky run --group group-name

## run task with name: 'task-name'
#husky run --name task-name

## pass hook arguments to task
#husky run --args "$1" "$2"

## or put your custom commands -------------------
#echo 'Husky.Net is awesome!'
11 changes: 11 additions & 0 deletions .husky/task-runner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://alirezanet.github.io/Husky.Net/schema.json",
"tasks": [
{
"name": "Run csharpier",
"command": "dotnet",
"args": ["csharpier", "format", "${staged}"],
"include": ["**/*.cs", "**/*.csx", "**/*.csproj", "**/*.props", "**/*.targets", "**/*.xml", "**/*.config"]
}
]
}
13 changes: 0 additions & 13 deletions .pre-commit-config.yaml

This file was deleted.

28 changes: 28 additions & 0 deletions .zed/debug.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[
{
"label": "Attach xUnit Test",
"adapter": "netcoredbg",
"request": "attach",
"processId": 96414,
},
{
"label": "Debug .NET Core App",
"adapter": "netcoredbg",
"request": "launch",
"program": "${ZED_WORKTREE_ROOT}/test/Motor.Extensions.Utilities_IntegrationTest/obj/Debug/net10.0/Motor.Extensions.Utilities_IntegrationTest.dll",
"cwd": "${ZED_WORKTREE_ROOT}/test/Motor.Extensions.Utilities_IntegrationTest",
"env": {
"ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_URLS": "http://localhost:5243",
},
"build": {
"command": "dotnet",
"args": [
"build",
"${ZED_WORKTREE_ROOT}/test/Motor.Extensions.Utilities_IntegrationTest/Motor.Extensions.Utilities_IntegrationTest.csproj",
"-p:Configuration=Debug",
"-p:TargetFramework=net10.0",
],
},
},
]
1 change: 0 additions & 1 deletion Motor.NET.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
Readme.md = Readme.md
shared.csproj = shared.csproj
.editorconfig = .editorconfig
.pre-commit-config.yaml = .pre-commit-config.yaml
EndProjectSection
Expand Down
1 change: 1 addition & 0 deletions shared.csproj → src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project>
<PropertyGroup>
<Version>0.16.0</Version>
<TargetFrameworks>net8.0;net9.0;net10.0;</TargetFrameworks>
<LangVersion>11</LangVersion>
<Nullable>enable</Nullable>
<WarningsAsErrors>CS8600;CS8602;CS8625;CS8618;CS8604;CS8601</WarningsAsErrors>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CloudNative.CloudEvents" Version="2.8.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Motor.Extensions.Hosting.CloudEvents\Motor.Extensions.Hosting.CloudEvents.csproj" />
</ItemGroup>
<Import Project="$(MSBuildThisFileDirectory)../../shared.csproj" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Motor.Extensions.ContentEncoding.Abstractions\Motor.Extensions.ContentEncoding.Abstractions.csproj" />
<ProjectReference Include="..\Motor.Extensions.Hosting.Abstractions\Motor.Extensions.Hosting.Abstractions.csproj" />
</ItemGroup>
<Import Project="$(MSBuildThisFileDirectory)../../shared.csproj" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)../../shared.csproj" />
</Project>
<Project Sdk="Microsoft.NET.Sdk"></Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Motor.Extensions.Conversion.Abstractions\Motor.Extensions.Conversion.Abstractions.csproj" />
<ProjectReference Include="..\Motor.Extensions.Hosting.Abstractions\Motor.Extensions.Hosting.Abstractions.csproj" />
Expand All @@ -11,5 +8,4 @@
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.10" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
</ItemGroup>
<Import Project="$(MSBuildThisFileDirectory)../../shared.csproj" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Motor.Extensions.Conversion.Abstractions\Motor.Extensions.Conversion.Abstractions.csproj" />
<ProjectReference Include="..\Motor.Extensions.Hosting.Abstractions\Motor.Extensions.Hosting.Abstractions.csproj" />
Expand All @@ -11,5 +8,4 @@
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.10" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.10" />
</ItemGroup>
<Import Project="$(MSBuildThisFileDirectory)../../shared.csproj" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Motor.Extensions.Conversion.Abstractions\Motor.Extensions.Conversion.Abstractions.csproj" />
<ProjectReference Include="..\Motor.Extensions.Hosting.Abstractions\Motor.Extensions.Hosting.Abstractions.csproj" />
Expand All @@ -11,5 +8,4 @@
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.10" />
<PackageReference Include="System.Text.Json" Version="9.0.10" />
</ItemGroup>
<Import Project="$(MSBuildThisFileDirectory)../../shared.csproj" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<Import Project="$(MSBuildThisFileDirectory)../../shared.csproj" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.10" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.10" />
Expand All @@ -14,5 +11,4 @@
<ProjectReference Include="..\Motor.Extensions.Diagnostics.Sentry\Motor.Extensions.Diagnostics.Sentry.csproj" />
<ProjectReference Include="..\Motor.Extensions.Utilities.Abstractions\Motor.Extensions.Utilities.Abstractions.csproj" />
</ItemGroup>
<Import Project="$(MSBuildThisFileDirectory)../../shared.csproj" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Prometheus.Client" Version="6.1.0" />
</ItemGroup>
<Import Project="$(MSBuildThisFileDirectory)../../shared.csproj" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
Expand All @@ -24,5 +21,4 @@
<ProjectReference Include="..\Motor.Extensions.Hosting.Abstractions\Motor.Extensions.Hosting.Abstractions.csproj" />
<ProjectReference Include="..\Motor.Extensions.Utilities.Abstractions\Motor.Extensions.Utilities.Abstractions.csproj" />
</ItemGroup>
<Import Project="$(MSBuildThisFileDirectory)../../shared.csproj" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)../../shared.csproj" />
</Project>
<Project Sdk="Microsoft.NET.Sdk"></Project>
Loading