Skip to content

Commit 2687388

Browse files
committed
Updates to sonarcloud workflow
1 parent 6e40710 commit 2687388

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.github/workflows/main.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ jobs:
130130
with:
131131
setAllVars: true
132132

133+
- name: Setting VERSION and BRANCH env
134+
run: |
135+
echo "::set-env name=VERSION::$NBGV_NuGetPackageVersion"
136+
echo "::set-env name=BRANCH::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')"
137+
133138
- uses: actions/setup-dotnet@v1
134139
with:
135140
dotnet-version: '3.1.x'
@@ -144,9 +149,12 @@ jobs:
144149
shell: bash
145150
env:
146151
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
152+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
153+
BRANCH: ${{ $BRANCH }}
147154
run: |
148-
dotnet sonarscanner begin /k:"egil_bUnit" /o:"egil" /n:"bUnit" /v:"$NBGV_NuGetPackageVersion" /d:sonar.login="$SONAR_TOKEN" /d:sonar.host.url=https://sonarcloud.io
149-
dotnet build bunit.sln
155+
dotnet sonarscanner begin /k:"egil_bUnit" /o:"egil" /n:"bUnit" /v:"$NBGV_NuGetPackageVersion" /d:sonar.login="$SONAR_TOKEN" /d:sonar.host.url=https://sonarcloud.io /d:sonar.branch.name="$BRANCH"
156+
dotnet build /p:UseSourceLink=true
157+
dotnet test --no-build /p:CollectCoverage=true /p:CoverletOutput=./coverage/ /p:CoverletOutputFormat=opencover /p:ExcludeByAttribute=\"Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute\" /p:UseSourceLink=true
150158
dotnet sonarscanner end /d:sonar.login="$SONAR_TOKEN"
151159
152160
code-ql:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,3 +335,4 @@ bunit.docs/log.txt
335335
.store
336336
*coverage*.info
337337
.sonarqube
338+
tests/*/coverage

0 commit comments

Comments
 (0)