Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 8 additions & 16 deletions .github/workflows/build-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:

outputs:
name: ${{ steps.initialize.outputs.name }}
docker_tag: ${{ steps.initialize.outputs.docker_tag }}
version: ${{ steps.initialize.outputs.version }}

steps:
Expand All @@ -38,31 +37,25 @@ jobs:
run: |
NAME=$(echo ${GITHUB_REPOSITORY} | tr '[:upper:]' '[:lower:]')
VERSION_PREFIX=$(date +'%Y.%m.%d').${GITHUB_RUN_NUMBER}
BRANCH_CURRENT=${GITHUB_REF#refs/*/}
BRANCH_CURRENT=${BRANCH_CURRENT//[^a-zA-Z0-9]/-}

if [[ ${GITHUB_EVENT_NAME} == 'pull_request' ]]; then
BRANCH_BASE=${GITHUB_BASE_REF#refs/*/}
BRANCH_BASE=${BRANCH_BASE/[^a-zA-Z0-9]//-}
BRANCH_COMPARE=${GITHUB_HEAD_REF#refs/*/}
BRANCH_COMPARE=${BRANCH_COMPARE//[^a-zA-Z0-9]/-}
VERSION_SUFFIX="merge-${BRANCH_BASE}-${BRANCH_COMPARE}"
elif [[ ${GITHUB_EVENT_NAME} == ${{ github.event.repository.default_branch }} ]]; then
VERSION_SUFFIX="${BRANCH_CURRENT}"
fi

if [[ $VERSION_SUFFIX == '' ]]; then
DOCKER_TAG=$VERSION_PREFIX
VERSION=$VERSION_PREFIX
else
DOCKER_TAG=$VERSION_PREFIX-$VERSION_SUFFIX
VERSION=$VERSION_PREFIX-$VERSION_SUFFIX
fi

echo "name=$(eval printf "%s" "$NAME")" >> $GITHUB_OUTPUT
echo "version_prefix=$(eval printf "%s" "$VERSION_PREFIX")" >> $GITHUB_OUTPUT
echo "version_suffix=$(eval printf "%s" "$VERSION_SUFFIX")" >> $GITHUB_OUTPUT
echo "docker_tag=$(eval printf "%s" "$DOCKER_TAG")" >> $GITHUB_OUTPUT
echo "version=$(eval printf "%s" "$DOCKER_TAG")" >> $GITHUB_OUTPUT
echo "branch=$(eval printf "%s" "$BRANCH_CURRENT")" >> $GITHUB_OUTPUT
echo "version=$(eval printf "%s" "$VERSION")" >> $GITHUB_OUTPUT
shell: bash

- name: Test
Expand All @@ -82,17 +75,16 @@ jobs:
run: |
docker build . \
--target run \
--tag $NAME:$DOCKER_TAG \
--tag $NAME:latest \
--tag $NAME:$VERSION \
--build-arg VERSION_PREFIX=$VERSION_PREFIX \
--build-arg VERSION_SUFFIX=$VERSION_SUFFIX
docker save $NAME:$DOCKER_TAG $NAME:latest --output image.tar
docker save $NAME:$VERSION --output image.tar
env:
DOCKER_BUILDKIT: 1
NAME: ${{ steps.initialize.outputs.name }}
VERSION_PREFIX: ${{ steps.initialize.outputs.version_prefix }}
VERSION_SUFFIX: ${{ steps.initialize.outputs.version_suffix }}
DOCKER_TAG: ${{ steps.initialize.outputs.docker_tag }}
VERSION: ${{ steps.initialize.outputs.version }}

- name: Setup .NET
id: setup
Expand Down Expand Up @@ -237,7 +229,7 @@ jobs:
id: scan
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
with:
image-ref: ${{ needs.build.outputs.name }}:${{ needs.build.outputs.docker_tag }}
image-ref: ${{ needs.build.outputs.name }}:${{ needs.build.outputs.version }}
format: sarif
output: trivy-results.sarif
severity: CRITICAL,HIGH
Expand All @@ -254,7 +246,7 @@ jobs:
id: enforce
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
with:
image-ref: ${{ needs.build.outputs.name }}:${{ needs.build.outputs.docker_tag }}
image-ref: ${{ needs.build.outputs.name }}:${{ needs.build.outputs.version }}
format: table
severity: CRITICAL,HIGH
ignore-unfixed: true
Expand Down
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ RUN for file in $(ls *.csproj); do mkdir -p tests/${file%.*}/ && mv $file tests/

RUN dotnet restore -v minimal

# Bust Cache
ARG CACHE_BUST 1

# Copy Remaining Files
COPY . .

Expand Down
9 changes: 0 additions & 9 deletions src/Application/Application.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,4 @@
<PackageReference Include="Mediator.Abstractions" Version="3.0.2" />
</ItemGroup>

<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>$(AssemblyName).Tests.Unit</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>DynamicProxyGenAssembly2</_Parameter1>
</AssemblyAttribute>
</ItemGroup>

</Project>
3 changes: 0 additions & 3 deletions src/Infrastructure/Infrastructure.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>$(AssemblyName).Tests.Integration</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>DynamicProxyGenAssembly2</_Parameter1>
</AssemblyAttribute>
</ItemGroup>

</Project>
72 changes: 0 additions & 72 deletions src/Presentation/Logging/ApplicationLog.cs

This file was deleted.

10 changes: 0 additions & 10 deletions src/Presentation/Presentation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
<NoWarn>$(NoWarn);1591</NoWarn>
</PropertyGroup>

<PropertyGroup Condition=" '$(RunConfiguration)' == 'CleanModelContextProtocol' " />

<ItemGroup>
<PackageReference Include="Mediator.SourceGenerator" Version="3.0.2">
<PrivateAssets>all</PrivateAssets>
Expand All @@ -23,7 +21,6 @@
<PackageReference Include="ModelContextProtocol.AspNetCore" Version="2.3.0" />
<PackageReference Include="Serilog.AspNetCore" Version="10.0.0" />
<PackageReference Include="Serilog.Enrichers.Environment" Version="3.0.1" />
<PackageReference Include="Serilog.Enrichers.Thread" Version="4.0.0" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="10.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.1.1" />
<PackageReference Include="Serilog.Sinks.Seq" Version="9.1.0" />
Expand All @@ -40,11 +37,4 @@
</AssemblyAttribute>
</ItemGroup>

<ItemGroup>
<None Include="../../icon.png" Pack="true" PackagePath="images/">
<Link>images/icon.png</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
</PackageReference>
<PackageReference Include="Microsoft.Extensions.TimeProvider.Testing" Version="10.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.11.0" />
<PackageReference Include="NSubstitute" Version="6.2.0" />
<PackageReference Include="Shouldly" Version="4.3.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="4.0.1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ public static class JsonSerializerExtensions
}
};

public static string Serialize(this object input)
{
return JsonSerializer.Serialize(input, Options);
}

public static T Deserialize<T>(this string input)
{
return JsonSerializer.Deserialize<T>(input, Options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.14" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.11.0" />
<PackageReference Include="NSubstitute" Version="6.2.0" />
<PackageReference Include="Shouldly" Version="4.3.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="4.0.1">
Expand Down
Loading