Skip to content

Commit 41f2b00

Browse files
authored
Merge pull request #1 from managedcode/copilot/create-empty-project-with-aspire-step
Add .NET 9 Aspire project template with API, tests, and comprehensive CI/CD workflows
2 parents aa4363e + 3ddaeb8 commit 41f2b00

23 files changed

+1178
-1
lines changed

.editorconfig

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# All files
7+
[*]
8+
charset = utf-8
9+
indent_style = space
10+
indent_size = 4
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
14+
# XML project files
15+
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
16+
indent_size = 2
17+
18+
# XML config files
19+
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
20+
indent_size = 2
21+
22+
# JSON files
23+
[*.json]
24+
indent_size = 2
25+
26+
# YAML files
27+
[*.{yml,yaml}]
28+
indent_size = 2
29+
30+
# Shell scripts
31+
[*.sh]
32+
end_of_line = lf
33+
34+
# Markdown files
35+
[*.md]
36+
trim_trailing_whitespace = false
37+
38+
# Dotnet code style settings
39+
[*.{cs,vb}]
40+
# Organize usings
41+
dotnet_sort_system_directives_first = true
42+
dotnet_separate_import_directive_groups = false
43+
44+
# this. preferences
45+
dotnet_style_qualification_for_field = false:warning
46+
dotnet_style_qualification_for_property = false:warning
47+
dotnet_style_qualification_for_method = false:warning
48+
dotnet_style_qualification_for_event = false:warning
49+
50+
# Language keywords vs BCL types preferences
51+
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
52+
dotnet_style_predefined_type_for_member_access = true:warning
53+
54+
# Parentheses preferences
55+
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
56+
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
57+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
58+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
59+
60+
# Modifier preferences
61+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:warning
62+
dotnet_style_readonly_field = true:warning
63+
64+
# Expression-level preferences
65+
dotnet_style_object_initializer = true:suggestion
66+
dotnet_style_collection_initializer = true:suggestion
67+
dotnet_style_explicit_tuple_names = true:suggestion
68+
dotnet_style_null_propagation = true:suggestion
69+
dotnet_style_coalesce_expression = true:suggestion
70+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
71+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
72+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
73+
dotnet_style_prefer_auto_properties = true:silent
74+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
75+
dotnet_style_prefer_conditional_expression_over_return = true:silent
76+
77+
# CSharp code style settings
78+
[*.cs]
79+
# var preferences
80+
csharp_style_var_for_built_in_types = true:silent
81+
csharp_style_var_when_type_is_apparent = true:suggestion
82+
csharp_style_var_elsewhere = true:silent
83+
84+
# Expression-bodied members
85+
csharp_style_expression_bodied_methods = false:silent
86+
csharp_style_expression_bodied_constructors = false:silent
87+
csharp_style_expression_bodied_operators = false:silent
88+
csharp_style_expression_bodied_properties = true:suggestion
89+
csharp_style_expression_bodied_indexers = true:suggestion
90+
csharp_style_expression_bodied_accessors = true:suggestion
91+
92+
# Pattern matching preferences
93+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
94+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
95+
96+
# Null-checking preferences
97+
csharp_style_throw_expression = true:suggestion
98+
csharp_style_conditional_delegate_call = true:suggestion
99+
100+
# Modifier preferences
101+
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
102+
103+
# Expression-level preferences
104+
csharp_prefer_braces = true:silent
105+
csharp_style_deconstructed_variable_declaration = true:suggestion
106+
csharp_prefer_simple_default_expression = true:suggestion
107+
csharp_style_pattern_local_over_anonymous_function = true:suggestion
108+
csharp_style_inlined_variable_declaration = true:suggestion
109+
110+
# New line preferences
111+
csharp_new_line_before_open_brace = all
112+
csharp_new_line_before_else = true
113+
csharp_new_line_before_catch = true
114+
csharp_new_line_before_finally = true
115+
csharp_new_line_before_members_in_object_initializers = true
116+
csharp_new_line_before_members_in_anonymous_types = true
117+
csharp_new_line_between_query_expression_clauses = true
118+
119+
# Indentation preferences
120+
csharp_indent_case_contents = true
121+
csharp_indent_switch_labels = true
122+
csharp_indent_labels = flush_left
123+
124+
# Space preferences
125+
csharp_space_after_cast = false
126+
csharp_space_after_keywords_in_control_flow_statements = true
127+
csharp_space_between_method_call_parameter_list_parentheses = false
128+
csharp_space_between_method_declaration_parameter_list_parentheses = false
129+
csharp_space_between_parentheses = false
130+
csharp_space_before_colon_in_inheritance_clause = true
131+
csharp_space_after_colon_in_inheritance_clause = true
132+
csharp_space_around_binary_operators = before_and_after
133+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
134+
csharp_space_between_method_call_name_and_opening_parenthesis = false
135+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
136+
137+
# Wrapping preferences
138+
csharp_preserve_single_line_statements = true
139+
csharp_preserve_single_line_blocks = true

.github/workflows/ci.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
push:
7+
branches: [ main ]
8+
9+
env:
10+
DOTNET_VERSION: '9.0.x'
11+
12+
jobs:
13+
build:
14+
name: Build and Test
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v5
22+
23+
- name: Setup .NET
24+
uses: actions/setup-dotnet@v4
25+
with:
26+
dotnet-version: ${{ env.DOTNET_VERSION }}
27+
28+
- name: Install Aspire workload
29+
run: dotnet workload install aspire
30+
31+
- name: Restore dependencies
32+
run: dotnet restore
33+
34+
- name: Build
35+
run: dotnet build --configuration Release --no-restore
36+
37+
- name: Test
38+
run: dotnet test --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage"
39+
40+
- name: Upload coverage reports to Codecov
41+
uses: codecov/codecov-action@v5
42+
with:
43+
token: ${{ secrets.CODECOV_TOKEN }}
44+
files: ./**/coverage.cobertura.xml
45+
fail_ci_if_error: false
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
schedule:
9+
- cron: '0 0 * * 1'
10+
11+
env:
12+
DOTNET_VERSION: '9.0.x'
13+
14+
jobs:
15+
analyze:
16+
name: Analyze
17+
runs-on: ubuntu-latest
18+
permissions:
19+
actions: read
20+
contents: read
21+
security-events: write
22+
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
language: [ 'csharp' ]
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v5
31+
32+
- name: Setup .NET
33+
uses: actions/setup-dotnet@v4
34+
with:
35+
dotnet-version: ${{ env.DOTNET_VERSION }}
36+
37+
- name: Install Aspire workload
38+
run: dotnet workload install aspire
39+
40+
- name: Initialize CodeQL
41+
uses: github/codeql-action/init@v4
42+
with:
43+
languages: ${{ matrix.language }}
44+
45+
- name: Restore dependencies
46+
run: dotnet restore
47+
48+
- name: Build
49+
run: dotnet build --no-restore
50+
51+
- name: Perform CodeQL Analysis
52+
uses: github/codeql-action/analyze@v4

0 commit comments

Comments
 (0)