Skip to content

Started implementing CSP Nonce #68

Started implementing CSP Nonce

Started implementing CSP Nonce #68

Workflow file for this run

name: Build
on:
release:
types: [published]
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
actions: read
checks: write
jobs:
build:
env:
BUILD_CONFIG: "Release"
PROJECT: "./src/Umbraco.Community.CSPManager/Umbraco.Community.CSPManager.csproj"
TESTPROJECT: "./src/Umbraco.Community.CSPManager.Tests/Umbraco.Community.CSPManager.Tests.csproj"
BUILD_VERSION: ${{ github.event.release.tag_name || '0.0.0' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup NuGet
uses: NuGet/setup-nuget@v1
with:
nuget-version: "6.x"
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.x
7.x
- name: Restore package dependencies
run: nuget restore $PROJECT
- name: Restore test dependencies
run: nuget restore $TESTPROJECT
- name: Build package
run: dotnet build $PROJECT -c $BUILD_CONFIG -p:Version=$BUILD_VERSION --no-restore
- name: Build test
run: dotnet build $TESTPROJECT -c $BUILD_CONFIG -p:Version=$BUILD_VERSION --no-restore
- name: Run tests
run: dotnet test $TESTPROJECT -c $BUILD_CONFIG --no-build --verbosity normal --filter "Category!=LongRunning" --logger "trx;LogFileName=test-results.trx"
- name: Test Report
uses: dorny/test-reporter@v1
if: always()
with:
name: DotNET Tests
path: "**/test-results.trx"
reporter: dotnet-trx
fail-on-error: true
- name: Publish
if: github.event_name == 'release'
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}}