Skip to content

Commit 70a286d

Browse files
update build pipeline
1 parent b7ff1dc commit 70a286d

File tree

6 files changed

+59
-2
lines changed

6 files changed

+59
-2
lines changed

.editorconfig

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_size = 2
6+
indent_style = space
7+
insert_final_newline = true
8+
9+
[*.cs]
10+
indent_size = 4
11+
12+
# Remove this or Me qualification
13+
dotnet_diagnostic.IDE0003.severity = error
14+
dotnet_style_qualification_for_event = false:error
15+
dotnet_style_qualification_for_field = false:error
16+
dotnet_style_qualification_for_method = false:error
17+
dotnet_style_qualification_for_property = false:error
18+
19+
# Use var instead of explicit type
20+
dotnet_diagnostic.IDE0007.severity = error
21+
csharp_style_var_elsewhere = true
22+
csharp_style_var_for_built_in_types = true
23+
csharp_style_var_when_type_is_apparent = true
24+
25+
# Remove unnecessary using directives
26+
dotnet_diagnostic.IDE0005.severity = warning
27+
28+
# Use language keywords instead of framework type names for type references
29+
dotnet_diagnostic.IDE0049.severity = error
30+
dotnet_style_predefined_type_for_locals_parameters_members = true
31+
dotnet_style_predefined_type_for_member_access = true
32+
33+
# Formatting rule
34+
dotnet_diagnostic.IDE0055.severity = warning
35+
dotnet_sort_system_directives_first = true
36+
37+
# Require file header
38+
dotnet_diagnostic.IDE0073.severity = warning
39+
file_header_template = Copyright (c) Duende Software. All rights reserved.\nSee LICENSE in the project root for license information.
40+
41+
# Use file-scoped namespace
42+
dotnet_diagnostic.IDE0161.severity = error
43+
csharp_style_namespace_declarations = file_scoped

.github/workflow-gen/Program.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Duende Software. All rights reserved.
1+
// Copyright (c) Duende Software. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
33

44
using Logicality.GitHub.Actions.Workflow;
@@ -77,6 +77,8 @@ void GenerateCiWorkflow(Component component)
7777

7878
job.StepSetupDotNet();
7979

80+
job.StepVerifyFormatting();
81+
8082
foreach (var testProject in component.Tests)
8183
{
8284
job.StepTest(component.Name, testProject);
@@ -348,6 +350,10 @@ public static Step StepPush(this Job job, string destination, string sourceUrl,
348350
}
349351
return step.Run($"dotnet nuget push artifacts/*.nupkg --source {sourceUrl} --api-key {apiKey} --skip-duplicate");
350352
}
353+
public static Step StepVerifyFormatting(this Job job)
354+
=> job.Step()
355+
.Name("Verify Formatting")
356+
.Run($"dotnet format foss.slnx --verify-no-changes --no-restore");
351357

352358
public static void StepUploadArtifacts(this Job job, string componentName, bool uploadAlways = false)
353359
{
@@ -401,4 +407,4 @@ public class EventsInputContext() : Context("github.event.inputs")
401407
{
402408
public string Version => Expression($"{Name}.version");
403409
}
404-
}
410+
}

.github/workflows/access-token-management-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ jobs:
4242
6.0.x
4343
8.0.x
4444
9.0.x
45+
- name: Verify Formatting
46+
run: dotnet format foss.slnx --verify-no-changes --no-restore
4547
- name: Test - AccessTokenManagement.Tests
4648
run: dotnet test -c Release test/AccessTokenManagement.Tests --logger "console;verbosity=normal" --logger "trx;LogFileName=AccessTokenManagement.Tests.trx" --collect:"XPlat Code Coverage"
4749
- name: Test report

.github/workflows/identity-model-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ jobs:
4242
6.0.x
4343
8.0.x
4444
9.0.x
45+
- name: Verify Formatting
46+
run: dotnet format foss.slnx --verify-no-changes --no-restore
4547
- name: Test - IdentityModel.Tests
4648
run: dotnet test -c Release test/IdentityModel.Tests --logger "console;verbosity=normal" --logger "trx;LogFileName=IdentityModel.Tests.trx" --collect:"XPlat Code Coverage"
4749
- name: Test report

.github/workflows/identity-model-oidc-client-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ jobs:
4242
6.0.x
4343
8.0.x
4444
9.0.x
45+
- name: Verify Formatting
46+
run: dotnet format foss.slnx --verify-no-changes --no-restore
4547
- name: Test - IdentityModel.OidcClient.Tests
4648
run: dotnet test -c Release test/IdentityModel.OidcClient.Tests --logger "console;verbosity=normal" --logger "trx;LogFileName=IdentityModel.OidcClient.Tests.trx" --collect:"XPlat Code Coverage"
4749
- name: Test report

.github/workflows/ignore-this-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ jobs:
4242
6.0.x
4343
8.0.x
4444
9.0.x
45+
- name: Verify Formatting
46+
run: dotnet format foss.slnx --verify-no-changes --no-restore
4547
- name: Test - IgnoreThis.Tests
4648
run: dotnet test -c Release test/IgnoreThis.Tests --logger "console;verbosity=normal" --logger "trx;LogFileName=IgnoreThis.Tests.trx" --collect:"XPlat Code Coverage"
4749
- name: Test report

0 commit comments

Comments
 (0)