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
5 changes: 3 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ on:
permissions: write-all
jobs:
build:
uses: LayeredCraft/devops-templates/.github/workflows/package-build.yaml@v6.2
uses: LayeredCraft/devops-templates/.github/workflows/package-build.yaml@v7.0
with:
hasTests: true
useMtpRunner: true
testDirectory: "test"
enableCodeCoverage: true
coverageThreshold: 80
dotnet-version: |
8.0.x
9.0.x
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/pr-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ on:
permissions: write-all
jobs:
build:
uses: LayeredCraft/devops-templates/.github/workflows/pr-build.yaml@v6.2
uses: LayeredCraft/devops-templates/.github/workflows/pr-build.yaml@v7.0
with:
solution: LayeredCraft.Cdk.Constructs.slnx
hasTests: true
useMtpRunner: true
testDirectory: "test"
enableCodeCoverage: true
coverageThreshold: 80
dotnetVersion: |
8.0.x
9.0.x
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<VersionPrefix>2.1.4</VersionPrefix>
<VersionPrefix>2.1.5</VersionPrefix>
<!-- SPDX license identifier for MIT -->
<PackageLicenseExpression>MIT</PackageLicenseExpression>

Expand Down
3 changes: 2 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
</PropertyGroup>
<ItemGroup Label="Build">
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="10.0.103" />
<PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="18.4.1" />
</ItemGroup>
<ItemGroup Label="AWS">
<PackageVersion Include="Amazon.CDK.Lib" Version="2.238.0" />
Expand All @@ -12,7 +13,7 @@
<PackageVersion Include="AutoFixture" Version="4.18.1" />
<PackageVersion Include="AutoFixture.AutoNSubstitute" Version="4.18.1" />
<PackageVersion Include="AutoFixture.Xunit3" Version="4.19.0" />
<PackageVersion Include="AwesomeAssertions" Version="9.3.0" />
<PackageVersion Include="AwesomeAssertions" Version="9.4.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageVersion Include="NSubstitute" Version="5.3.0" />
<PackageVersion Include="xunit.v3.mtp-v2" Version="3.2.2" />
Expand Down
1 change: 1 addition & 0 deletions LayeredCraft.Cdk.Constructs.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<File Path="CLAUDE.md" />
<File Path="Directory.Build.props" />
<File Path="Directory.Packages.props" />
<File Path="global.json" />
<File Path="LICENSE" />
<File Path="README.md" />
</Folder>
Expand Down
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"test": {
"runner": "Microsoft.Testing.Platform"
}
}
11 changes: 8 additions & 3 deletions src/LayeredCraft.Cdk.Constructs/StaticSiteConstruct.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,22 @@ public StaticSiteConstruct(Construct scope, string id, IStaticSiteConstructProps
// Add API proxying behavior if API domain is specified
if (!string.IsNullOrWhiteSpace(props.ApiDomain))
{
distribution.AddBehavior("/api/*", new HttpOrigin(props.ApiDomain, new HttpOriginProps
var apiOrigin = new HttpOrigin(props.ApiDomain, new HttpOriginProps
{
ProtocolPolicy = OriginProtocolPolicy.HTTPS_ONLY
}), new BehaviorOptions
});

var apiBehaviorOptions = new BehaviorOptions
{
AllowedMethods = AllowedMethods.ALLOW_ALL,
CachePolicy = CachePolicy.CACHING_DISABLED,
OriginRequestPolicy = OriginRequestPolicy.ALL_VIEWER_EXCEPT_HOST_HEADER,
ViewerProtocolPolicy = ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
Compress = true
});
};

distribution.AddBehavior("/api", apiOrigin, apiBehaviorOptions);
distribution.AddBehavior("/api/*", apiOrigin, apiBehaviorOptions);
}

// Create primary DNS A record for the site domain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<PackageReference Include="AutoFixture.Xunit3"/>
<PackageReference Include="AwesomeAssertions" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" />
<PackageReference Include="NSubstitute"/>
<PackageReference Include="xunit.v3.mtp-v2" />
<PackageReference Include="xunit.runner.visualstudio">
Expand Down