Skip to content

Commit 64dd6d9

Browse files
authored
Add CI build workflow (#16)
1 parent c341542 commit 64dd6d9

29 files changed

+65
-36
lines changed

.editorconfig

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ indent_style = space
1111
tab_width = 4
1212

1313
# New line preferences
14-
end_of_line = crlf
15-
insert_final_newline = true
14+
end_of_line = lf
15+
insert_final_newline = false
1616

1717
#### .NET Coding Conventions ####
1818

@@ -391,9 +391,6 @@ dotnet_diagnostic.S4136.severity = none
391391
# S6605: Collection-specific "Exists" method should be used instead of the "Any" extension
392392
dotnet_diagnostic.S6605.severity = none
393393
dotnet_style_operator_placement_when_wrapping = beginning_of_line
394-
tab_width = 4
395-
indent_size = 4
396-
end_of_line = crlf
397394
dotnet_style_null_propagation = true:error
398395
dotnet_style_coalesce_expression = true:error
399396
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:error
@@ -411,4 +408,4 @@ dotnet_style_qualification_for_field = false:error
411408
dotnet_style_qualification_for_property = false:error
412409
dotnet_style_qualification_for_method = false:error
413410
dotnet_style_qualification_for_event = false:error
414-
dotnet_style_predefined_type_for_locals_parameters_members = true:error
411+
dotnet_style_predefined_type_for_locals_parameters_members = true:error

.gitattributes

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
# Auto detect text files and perform LF normalization
21
* text=auto
2+
*.{cmd,[cC][mM][dD]} text eol=crlf
3+
*.{bat,[bB][aA][tT]} text eol=crlf
4+
*.{ics,[iI][cC][sS]} text eol=crlf
5+
*.sh text eol=lf

.github/workflows/ci-build.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CI build
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Setup .NET
18+
uses: actions/setup-dotnet@v4
19+
with:
20+
dotnet-version: 9.0.x
21+
22+
- name: Restore dependencies
23+
run: dotnet restore KernelMemory.Ecommerce.Sample.sln
24+
25+
- name: Build
26+
run: dotnet build --no-restore KernelMemory.Ecommerce.Sample.sln
27+
28+
- name: Check fomatting
29+
run: dotnet format --verify-no-changes KernelMemory.Ecommerce.Sample.sln
30+
31+
- name: Test
32+
run: dotnet test --no-build --verbosity normal KernelMemory.Ecommerce.Sample.sln

src/KernelMemory.Ecommerce.Sample.Api/Application/Configuration/ProductSearchOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ public class ProductSearchOptions
1010
public required int SearchResultsLimit { get; init; }
1111
[Required]
1212
public required double MinSearchResultsRelevance { get; init; }
13-
}
13+
}

src/KernelMemory.Ecommerce.Sample.Api/Application/CsvReader/CsvReaderErrors.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ public static Error ReadRecordsFailed(Exception ex)
1010
"CsvReader.ReadRecords.Failed",
1111
$"An error occurred while parsing the CSV file. Details: {ex.Message}");
1212
}
13-
}
13+
}

src/KernelMemory.Ecommerce.Sample.Api/Application/CsvReader/ICsvReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ public interface ICsvReader<TRecord>
66
{
77
Task<Result<IReadOnlyCollection<TRecord>>> ReadRecordsAsync(
88
Stream stream, CancellationToken cancellationToken = default);
9-
}
9+
}

src/KernelMemory.Ecommerce.Sample.Api/Application/ICommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ public interface IBaseCommand;
88
public interface ICommand<TResponse> : IRequest<Result<TResponse>>, IBaseCommand;
99

1010
public interface ICommandHandler<in TCommand, TResponse> : IRequestHandler<TCommand, Result<TResponse>>
11-
where TCommand : ICommand<TResponse>;
11+
where TCommand : ICommand<TResponse>;

src/KernelMemory.Ecommerce.Sample.Api/Application/IQuery.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ namespace KernelMemory.Ecommerce.Sample.Api.Application;
66
public interface IQuery<TResponse> : IRequest<Result<TResponse>>;
77

88
public interface IQueryHandler<in TQuery, TResponse> : IRequestHandler<TQuery, Result<TResponse>>
9-
where TQuery : IQuery<TResponse>;
10-
9+
where TQuery : IQuery<TResponse>;

src/KernelMemory.Ecommerce.Sample.Api/Application/ProductIngestionCommand/ProductIngestionCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ public async Task<Result<IReadOnlyCollection<string>>> Handle(ProductIngestionCo
3232

3333
return documentIds;
3434
}
35-
}
35+
}

src/KernelMemory.Ecommerce.Sample.Api/Application/ProductSearchQueries/ProductRagSearchQuery.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ public async Task<Result<ProductSearchResponse>> Handle(
4545
memoryAnswer.RelevantSources.Count,
4646
foundProducts);
4747
}
48-
}
48+
}

0 commit comments

Comments
 (0)