-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/optimisations for header value builders (#130)
* Optimised builders for header values; moved some usings out to global usings; BREAKING CHANGE: Removed the ability to remove the "X-Powered-By" header; * Renamed badly named method (UseContentDefaultSecurityPolicy -> UseDefaultContentSecurityPolicy) * Ran solution-wide formatting fix * Updated changelog * Added support for providing code coverage reports on PR builds * Fixed typo in actions file * Removed specific tests file name * Attempt at forcing dotnet test to find the sln * Added Working Directory to test command. * Silly mistake: added the steps which actually pull the code. Remember: each job is a separate container instance * Finalised release action file --------- Co-authored-by: Jamie Taylor <[email protected]>
- Loading branch information
1 parent
84cb0a6
commit 95e8c36
Showing
63 changed files
with
861 additions
and
691 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 |
---|---|---|
|
@@ -24,7 +24,7 @@ jobs: | |
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 6.0.x | ||
dotnet-version: '9.0.x' | ||
|
||
- name: Install dotnet-format tool | ||
run: dotnet tool install -g dotnet-format | ||
|
@@ -35,16 +35,16 @@ jobs: | |
build: | ||
|
||
needs: [check-code-formatting] | ||
|
||
runs-on: ubuntu-latest | ||
name: Build code base, checking for compilation errors | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup .NET Core | ||
- name: Setup .NET SDK | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: '9.0.x' | ||
|
@@ -54,12 +54,66 @@ jobs: | |
|
||
- name: Build | ||
run: dotnet build --configuration Release --no-restore | ||
|
||
test: | ||
# This job is adapted from https://josh-ops.com/posts/github-code-coverage/ | ||
# It adds a code coverage report to all PR builds | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
name: Run all tests and generate PR-level code coverage report | ||
|
||
steps: | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup .NET SDK | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: '9.0.x' | ||
|
||
- name: Run all tests | ||
run: dotnet test OwaspHeaders.Core.sln --verbosity normal --collect:"XPlat Code Coverage" --logger trx --results-directory coverage | ||
working-directory: ${{env.working-directory}} | ||
|
||
- name: Test | ||
run: dotnet test --no-restore --verbosity normal | ||
- name: Code Coverage Summary Report | ||
uses: irongut/[email protected] | ||
with: | ||
filename: 'coverage/*/coverage.cobertura.xml' | ||
badge: true | ||
format: 'markdown' | ||
output: 'both' | ||
|
||
- name: Add Coverage PR Comment | ||
uses: marocchino/[email protected] | ||
if: github.event_name == 'pull_request' | ||
with: | ||
recreate: true | ||
path: code-coverage-results.md | ||
|
||
- name: Write to Job Summary | ||
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY | ||
|
||
package: | ||
needs: [build, test] | ||
runs-on: ubuntu-latest | ||
name: Create the NuGet package for PR-level user testing | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup .NET SDK | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: '9.0.x' | ||
|
||
- name: pack | ||
run: dotnet pack src/OwaspHeaders.Core.csproj --configuration Release --no-build --no-restore | ||
- name: Build NuGet Package | ||
run: dotnet pack src/OwaspHeaders.Core.csproj --configuration Release | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: ${{ success() }} | ||
|
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 @@ | ||
global using OwaspHeaders.Core.Extensions; |
Oops, something went wrong.