Skip to content

Commit 2cadb08

Browse files
RestClient .Net 7
1 parent a07475e commit 2cadb08

File tree

473 files changed

+37848
-14911
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

473 files changed

+37848
-14911
lines changed

.config/dotnet-tools.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"fantomas": {
6+
"version": "6.3.15",
7+
"commands": [
8+
"fantomas"
9+
],
10+
"rollForward": false
11+
},
12+
"dotnet-stryker": {
13+
"version": "4.8.1",
14+
"commands": [
15+
"dotnet-stryker"
16+
],
17+
"rollForward": false
18+
}
19+
}
20+
}

.editorconfig

Lines changed: 381 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/buildandtest.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

.github/workflows/pr-build.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: PR Build
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-and-test:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup .NET
17+
uses: actions/setup-dotnet@v4
18+
with:
19+
dotnet-version: |
20+
8.0.x
21+
9.0.x
22+
23+
- name: Restore dependencies
24+
run: dotnet restore RestClient.sln
25+
26+
- name: Check code formatting with CSharpier
27+
run: |
28+
dotnet tool install --global csharpier
29+
dotnet csharpier --check .
30+
31+
- name: Build solution
32+
run: dotnet build RestClient.sln --configuration Release --no-restore /warnaserror
33+
34+
- name: Run all tests with code coverage
35+
run: dotnet test RestClient.sln --configuration Release --no-build --verbosity normal --logger "console;verbosity=detailed" --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Threshold=100 DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.ThresholdType=line,branch,method DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.ThresholdStat=total
36+
37+
- name: Install Stryker Mutator
38+
run: dotnet tool install --global dotnet-stryker
39+
40+
- name: Run Stryker Mutation Testing
41+
run: dotnet stryker --break-at 100 --reporter "console" --reporter "html"
42+
43+
- name: Run code analysis
44+
run: dotnet build RestClient.sln --configuration Release --no-restore /p:RunAnalyzers=true /p:TreatWarningsAsErrors=true
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Publish Exhaustion Analyzer to NuGet
2+
3+
on:
4+
push:
5+
tags:
6+
- 'exhaustion-v*'
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'Version number (e.g., 1.0.0)'
11+
required: true
12+
type: string
13+
14+
jobs:
15+
publish:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup .NET
23+
uses: actions/setup-dotnet@v4
24+
with:
25+
dotnet-version: '8.0.x'
26+
27+
- name: Restore dependencies
28+
run: dotnet restore Exhaustion/Exhaustion.csproj
29+
30+
- name: Build
31+
run: dotnet build Exhaustion/Exhaustion.csproj --configuration Release --no-restore
32+
33+
- name: Set version from tag
34+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
35+
run: |
36+
VERSION=${GITHUB_REF#refs/tags/exhaustion-v}
37+
echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV
38+
39+
- name: Set version from input
40+
if: github.event_name == 'workflow_dispatch'
41+
run: |
42+
echo "PACKAGE_VERSION=${{ vars.PACKAGE_VERSION }}" >> $GITHUB_ENV
43+
44+
- name: Pack
45+
run: dotnet pack Exhaustion/Exhaustion.csproj --configuration Release --no-build --output ./packages /p:Version=${{ env.PACKAGE_VERSION }}
46+
47+
- name: Publish to NuGet
48+
run: dotnet nuget push ./packages/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
49+
env:
50+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
51+
52+
- name: Upload package artifact
53+
uses: actions/upload-artifact@v4
54+
with:
55+
name: exhaustion-nuget-package
56+
path: ./packages/*.nupkg
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Publish Outcome to NuGet
2+
3+
on:
4+
push:
5+
tags:
6+
- 'outcome-v*'
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'Version number (e.g., 1.0.0)'
11+
required: true
12+
type: string
13+
14+
jobs:
15+
publish:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup .NET
23+
uses: actions/setup-dotnet@v4
24+
with:
25+
dotnet-version: '8.0.x'
26+
27+
- name: Restore dependencies
28+
run: dotnet restore Results/Results.csproj
29+
30+
- name: Build
31+
run: dotnet build Results/Results.csproj --configuration Release --no-restore
32+
33+
- name: Set version from tag
34+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
35+
run: |
36+
VERSION=${GITHUB_REF#refs/tags/outcome-v}
37+
echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV
38+
39+
- name: Set version from input
40+
if: github.event_name == 'workflow_dispatch'
41+
run: |
42+
echo "PACKAGE_VERSION=${{ vars.RESULTS_PACKAGE_VERSION }}" >> $GITHUB_ENV
43+
44+
- name: Pack
45+
run: dotnet pack Results/Results.csproj --configuration Release --no-build --output ./packages /p:Version=${{ env.PACKAGE_VERSION }}
46+
47+
- name: Publish to NuGet
48+
run: dotnet nuget push ./packages/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
49+
env:
50+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
51+
52+
- name: Upload package artifact
53+
uses: actions/upload-artifact@v4
54+
with:
55+
name: outcome-nuget-package
56+
path: ./packages/*.nupkg
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Publish RestClient.Net to NuGet
2+
3+
on:
4+
push:
5+
tags:
6+
- 'restclient-v*'
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'Version number (e.g., 6.0.0)'
11+
required: true
12+
type: string
13+
14+
jobs:
15+
publish:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup .NET
23+
uses: actions/setup-dotnet@v4
24+
with:
25+
dotnet-version: '8.0.x'
26+
27+
- name: Restore dependencies
28+
run: dotnet restore RestClient.Net/RestClient.Net.csproj
29+
30+
- name: Build
31+
run: dotnet build RestClient.Net/RestClient.Net.csproj --configuration Release --no-restore
32+
33+
- name: Set version from tag
34+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
35+
run: |
36+
VERSION=${GITHUB_REF#refs/tags/restclient-v}
37+
echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV
38+
39+
- name: Set version from input
40+
if: github.event_name == 'workflow_dispatch'
41+
run: |
42+
echo "PACKAGE_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
43+
44+
- name: Pack
45+
run: dotnet pack RestClient.Net/RestClient.Net.csproj --configuration Release --no-build --output ./packages /p:Version=${{ env.PACKAGE_VERSION }}
46+
47+
- name: Publish to NuGet
48+
run: dotnet nuget push ./packages/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
49+
env:
50+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
51+
52+
- name: Upload package artifact
53+
uses: actions/upload-artifact@v4
54+
with:
55+
name: restclient-nuget-package
56+
path: ./packages/*.nupkg

.gitignore

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,16 @@
1-
*.Designer.cs
2-
*.csproj.user
3-
/.vs/RESTClient .Net/v14/.suo/
4-
/NuGet/Exported/
51
bin/
62
obj/
7-
packages/
8-
/.vs/restore.dg
9-
/RESTClientDotNet.Net/.vs
10-
/CF.RESTClientDotNet.Net/.vs/*.dg
11-
*.suo
12-
.vs
13-
*.pdb
14-
*.dll
15-
project.fragment.lock.json
16-
project.lock.json
17-
*.CodeAnalysisLog.xml
18-
*.lastcodeanalysissucceeded
3+
.DS_Store
194

20-
src/.idea/*
5+
.idea/.idea.RestClient/.idea/
216

22-
*.user
7+
RestClient.sln.DotSettings.user
238

24-
src/RestClient.Net.Abstractions/RestClient.Net.Abstractions.xml
9+
RestClient.Net.CsTest/TestResults/
2510

26-
src/RestClient.Net/RestClient.Net.xml
11+
coverage/
12+
coverage.cobertura.xml
2713

28-
.ionide/
14+
15+
final-check/
16+
test-output-final

.vscode/launch.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Generator: JSONPlaceholder",
6+
"type": "coreclr",
7+
"request": "launch",
8+
"preLaunchTask": "build",
9+
"program": "${workspaceFolder}/RestClient.Net.Generator/bin/Debug/net9.0/RestClient.Net.Generator.dll",
10+
"args": [
11+
"-u",
12+
"${workspaceFolder}/Samples/RestClient.OpenApiGenerator.Sample/jsonplaceholder-openapi.json",
13+
"-o",
14+
"${workspaceFolder}/Samples/RestClient.OpenApiGenerator.Sample.JSONPlaceholder/Generated",
15+
"-n",
16+
"JSONPlaceholder.Generated",
17+
"-c",
18+
"JSONPlaceholderApiExtensions",
19+
"-b",
20+
"https://jsonplaceholder.typicode.com"
21+
],
22+
"cwd": "${workspaceFolder}/RestClient.Net.Generator",
23+
"console": "internalConsole",
24+
"stopAtEntry": false
25+
},
26+
{
27+
"name": "Generator: NucliaDB (Local YAML)",
28+
"type": "coreclr",
29+
"request": "launch",
30+
"preLaunchTask": "build",
31+
"program": "${workspaceFolder}/RestClient.Net.Generator/bin/Debug/net9.0/RestClient.Net.Generator.dll",
32+
"args": [
33+
"-u",
34+
"${workspaceFolder}/Samples/NucliaDbClient/api.yaml",
35+
"-o",
36+
"${workspaceFolder}/Samples/RestClient.OpenApiGenerator.Sample.NucliaDB/Generated",
37+
"-n",
38+
"NucliaDB.Generated",
39+
"-c",
40+
"NucliaDBApiExtensions",
41+
"-v",
42+
"3.0.2"
43+
],
44+
"cwd": "${workspaceFolder}/RestClient.Net.Generator",
45+
"console": "internalConsole",
46+
"stopAtEntry": false
47+
}
48+
]
49+
}

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"dotnet.backgroundAnalysis.analyzerDiagnosticsScope": "fullSolution",
3+
"dotnet.backgroundAnalysis.compilerDiagnosticsScope": "fullSolution"
4+
}

0 commit comments

Comments
 (0)