diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml new file mode 100644 index 00000000..0075a490 --- /dev/null +++ b/.github/workflows/sonarcloud.yml @@ -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 }}" \ No newline at end of file diff --git a/TransactionProcessor/nlog.config b/TransactionProcessor/nlog.config index 0dd53505..5a5d9937 100644 --- a/TransactionProcessor/nlog.config +++ b/TransactionProcessor/nlog.config @@ -5,20 +5,20 @@ + 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"/> + 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"/>