-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
well things work now, lets see how ci goes
- Loading branch information
1 parent
4235961
commit d3ca752
Showing
63 changed files
with
719 additions
and
1,951 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,18 +140,6 @@ jobs: | |
id: default | ||
run: | | ||
dotnet .build/bin/Debug/.build.dll --target Default --skip Restore Build Test Pack | ||
- name: 🏺 Publish coverage data | ||
if: always() | ||
uses: actions/[email protected] | ||
with: | ||
name: 'coverage' | ||
path: 'coverage/' | ||
- name: 📫 Publish Coverage | ||
if: (github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || ((github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.pull_request.user.login != 'renovate[bot]' && github.event.pull_request.user.login != 'dependabot[bot]') | ||
uses: codecov/[email protected] | ||
with: | ||
name: 'actions-${{ matrix.os }}' | ||
token: '${{ secrets.CODECOV_TOKEN }}' | ||
- name: 🏺 Publish logs | ||
if: always() | ||
uses: actions/[email protected] | ||
|
@@ -184,7 +172,7 @@ jobs: | |
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | ||
- name: 📫 Publish Codecov Coverage | ||
if: (github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || ((github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.pull_request.user.login != 'renovate[bot]' && github.event.pull_request.user.login != 'dependabot[bot]') | ||
uses: codecov/[email protected].3 | ||
uses: codecov/[email protected].7 | ||
with: | ||
name: 'actions' | ||
token: '${{ secrets.CODECOV_TOKEN }}' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Microsoft.Extensions.Options; | ||
|
||
internal class CustomHostedService(IOptions<CustomHostedServiceOptions> options) : BackgroundService | ||
{ | ||
protected override Task ExecuteAsync(CancellationToken stoppingToken) | ||
{ | ||
// ReSharper disable once UnusedVariable | ||
var v = options.Value.A; | ||
return Task.CompletedTask; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using FluentValidation; | ||
|
||
internal class CustomHostedServiceOptions | ||
{ | ||
public string? A { get; set; } | ||
|
||
[UsedImplicitly] | ||
private sealed class Validator : AbstractValidator<CustomHostedServiceOptions> | ||
{ | ||
public Validator() | ||
{ | ||
RuleFor(z => z.A).NotNull(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
using MediatR; | ||
using Microsoft.AspNetCore.Http.HttpResults; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Sample.Core.Domain; | ||
using Sample.Core.Models; | ||
using Sample.Core.Operations.LaunchRecords; | ||
|
||
internal static partial class LaunchRecordEndpoints | ||
{ | ||
public static void UseLaunchRecords(this WebApplication app) | ||
{ | ||
app.MapGet("/launch-records", ListLaunchRecords); | ||
app.MapGet("/launch-records/{id:guid}", GetLaunchRecord); | ||
app.MapPost("/launch-records", CreateLaunchRecord); | ||
app.MapPut("/launch-records/{id:guid}", EditLaunchRecord); | ||
app.MapPatch("/launch-records/{id:guid}", PatchLaunchRecord); | ||
app.MapDelete("/launch-records/{id:guid}", DeleteLaunchRecord); | ||
} | ||
|
||
[EndpointName(nameof(ListLaunchRecords))] | ||
private static Ok<IAsyncEnumerable<LaunchRecordModel>> ListLaunchRecords(IMediator mediator, RocketType? rocketType) => | ||
TypedResults.Ok(mediator.CreateStream(new ListLaunchRecords.Request(rocketType))); | ||
|
||
[EndpointName(nameof(GetLaunchRecord))] | ||
private static async Task<Results<Ok<LaunchRecordModel>, NotFound, ProblemHttpResult>> GetLaunchRecord( | ||
IMediator mediator, | ||
LaunchRecordId id, | ||
CancellationToken cancellationToken | ||
) => TypedResults.Ok(await mediator.Send(new GetLaunchRecord.Request(id), cancellationToken)); | ||
|
||
[EndpointName(nameof(CreateLaunchRecord))] | ||
private static async Task<Results<CreatedAtRoute<CreateLaunchRecord.Response>, ProblemHttpResult, BadRequest>> CreateLaunchRecord( | ||
IMediator mediator, | ||
CreateLaunchRecord.Request request | ||
) | ||
{ | ||
return TypedResults.CreatedAtRoute(await mediator.Send(request), nameof(GetLaunchRecord)); | ||
} | ||
|
||
/// <summary> | ||
/// Does this comment get picked up? | ||
/// </summary> | ||
/// <param name="mediator"></param> | ||
/// <param name="id"></param> | ||
/// <param name="model"></param> | ||
/// <returns></returns> | ||
[EndpointName(nameof(EditLaunchRecord))] | ||
private static async Task<Results<Ok<LaunchRecordModel>, NotFound, ProblemHttpResult, BadRequest>> EditLaunchRecord( | ||
IMediator mediator, | ||
[FromRoute] | ||
LaunchRecordId id, | ||
EditLaunchRecord.Request model | ||
) => TypedResults.Ok(await mediator.Send(model with { Id = id })); | ||
|
||
[EndpointName(nameof(PatchLaunchRecord))] | ||
private static async Task<Results<Ok<LaunchRecordModel>, NotFound, ProblemHttpResult, BadRequest>> PatchLaunchRecord( | ||
IMediator mediator, | ||
[FromRoute] | ||
LaunchRecordId id, | ||
EditLaunchRecord.PatchRequest model | ||
) => TypedResults.Ok(await mediator.Send(model with { Id = id })); | ||
|
||
[EndpointName(nameof(DeleteLaunchRecord))] | ||
private static async Task<Results<NoContent, NotFound>> DeleteLaunchRecord(IMediator mediator, [FromRoute] LaunchRecordId id) | ||
{ | ||
await mediator.Send(new DeleteLaunchRecord.Request(id)); | ||
return TypedResults.NoContent(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.