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
51 changes: 51 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: SonarCloud Analysis

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
name: Build and analyze
runs-on: windows-latest
steps:
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.11
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~\sonar\cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache SonarCloud scanner
id: cache-sonar-scanner
uses: actions/cache@v1
with:
path: .\.sonar\scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner
- name: Install SonarCloud scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
shell: powershell
run: |
New-Item -Path .\.sonar\scanner -ItemType Directory
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: powershell
run: |
.\.sonar\scanner\dotnet-sonarscanner begin /k:"TransactionProcessing_TransactionProcessor" /o:"transactionprocessing" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
dotnet restore TransactionProcessor.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/transactionprocessing/api/v3/index.json
dotnet build TransactionProcessor.sln --configuration Release
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
24 changes: 12 additions & 12 deletions TransactionProcessor/nlog.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
<target name="asyncFile" xsi:type="AsyncWrapper">
<target name="logfile" xsi:type="File"
fileName="/home/txnproc/trace/transactionprocessor.log"
layout="${date:format=dd/MM/yyyy HH\:mm\:ss} | ${date:format=dd/MM/yyyy HH\:mm\:ss.ffff} | ${level} | ${callsite:className=true} | ${message} | ${exception:format=type,method:maxInnerExceptionLevel=5:innerFormat=shortType,message,method:InnerExceptionSeparator= | }"
archiveNumbering="Date"
archiveDateFormat="yyyyMMdd-HH"
archiveEvery="Hour"
keepFileOpen="false"
maxArchiveFiles="24"/>
layout="${date:format=dd/MM/yyyy HH\:mm\:ss.ffff} | ${level} | ${callsite:className=true} | ${message} | ${exception:format=type,method:maxInnerExceptionLevel=5:innerFormat=shortType,message,method:InnerExceptionSeparator= | }"
archiveFileName="/home/txnproc/trace/transactionprocessor.{#####}.log"
archiveAboveSize="104857600"
archiveNumbering="Sequence"
concurrentWrites="true"
maxArchiveFiles="2"/>
<target name="healthlogfile" xsi:type="File"
fileName="/home/txnproc/trace/transactionprocessor_health.log"
layout="${date:format=dd/MM/yyyy HH\:mm\:ss} | ${date:format=dd/MM/yyyy HH\:mm\:ss.ffff} | ${level} | ${callsite:className=true} | ${message} | ${exception:format=type,method:maxInnerExceptionLevel=5:innerFormat=shortType,message,method:InnerExceptionSeparator= | }"
archiveNumbering="Date"
archiveDateFormat="yyyyMMdd-HH"
archiveEvery="Hour"
keepFileOpen="false"
maxArchiveFiles="24"/>
layout="${date:format=dd/MM/yyyy HH\:mm\:ss.ffff} | ${level} | ${callsite:className=true} | ${message} | ${exception:format=type,method:maxInnerExceptionLevel=5:innerFormat=shortType,message,method:InnerExceptionSeparator= | }"
archiveFileName="/home/txnproc/trace/transactionprocessor_health.{#####}.log"
archiveAboveSize="104857600"
archiveNumbering="Sequence"
concurrentWrites="true"
maxArchiveFiles="2"/>
</target>
</targets>

Expand Down