Create codeql.yml #95
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
name: SonarCloud | |
on: | |
push: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
build: | |
name: Build and analyze | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build and analyze | |
shell: bash | |
run: | | |
export CODACY_API_TOKEN=8SkM1M6hxUP6nG43nSdL | |
export CODACY_ORGANIZATION_PROVIDER=gh | |
export CODACY_USERNAME=yogeshboddu | |
export CODACY_PROJECT_NAME=dotnet-app | |
dotnet test --logger "trx;LogFileName=test-results.trx" --collect:"XPlat Code Coverage" | |
- name: Generate Test Coverage Report | |
uses: danielpalme/[email protected] | |
with: | |
reports: '**/TestResults/*/coverage.cobertura.xml' | |
targetdir: coveragereport | |
reporttypes: 'HtmlInline;Cobertura;MarkdownSummary' | |
title: 'Coverage Report' | |
if: success() || failure() | |
- name: codacy upload | |
run: | | |
export CODACY_API_TOKEN=8SkM1M6hxUP6nG43nSdL | |
export CODACY_ORGANIZATION_PROVIDER=gh | |
export CODACY_USERNAME=yogeshboddu | |
export CODACY_PROJECT_NAME=dotnet-app | |
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coveragereport/Cobertura.xml | |
if: success() || failure() |