Skip to content

Commit

Permalink
Add SonarScanner to PR and master build (#128)
Browse files Browse the repository at this point in the history
Baseline would be the analysis on master, but there is none on master yet. Merging this to master should do that.
  • Loading branch information
robinvanpoppel committed Apr 24, 2020
1 parent 65d3ea7 commit 735f5ab
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/workflows/pr.yml
Expand Up @@ -22,12 +22,23 @@ jobs:
- name: nuget restore
run: nuget restore KeeTrayTOTP.sln

- name: Install dotnet-sonarscanner
run: dotnet tool install --global dotnet-sonarscanner

- name: SonarScanner Begin
run: dotnet sonarscanner begin /k:KeeTrayTOTP_KeeTrayTOTP /o:keetraytotp /d:sonar.host.url="https://sonarcloud.io"

- name: MSBuild
run: msbuild KeeTrayTOTP.sln /m

- name: Run tests
# It looks like the dotnet CLI can no longer build net45 projects? see https://github.com/microsoft/msbuild/issues/4704
run: dotnet test --no-build

- name: SonarScanner End
run: dotnet sonarscanner end
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

- name: MSBuild (With Plgx)
run: msbuild KeeTrayTOTP.sln /p:Configuration=ReleasePlgx
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/pre-release.yml
Expand Up @@ -27,14 +27,25 @@ jobs:
- name: nuget restore
run: nuget restore KeeTrayTOTP.sln

- name: Install dotnet-sonarscanner
run: dotnet tool install --global dotnet-sonarscanner

- name: SonarScanner Begin
run: dotnet sonarscanner begin /k:KeeTrayTOTP_KeeTrayTOTP /o:keetraytotp /d:sonar.host.url="https://sonarcloud.io"

- name: MSBuild (With Plgx)
run: msbuild KeeTrayTOTP.sln /p:Configuration=ReleasePlgx

- name: SonarScanner End
run: dotnet sonarscanner end
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

- name: Upload plgx
uses: actions/upload-artifact@v1
with:
name: KeeTrayTOTP.plgx
path: KeeTrayTOTP\bin\ReleasePlgx\KeeTrayTOTP.plgx
path: KeeTrayTOTP\bin\ReleasePlgx\KeeTrayTOTP.plgx

- name: Create prerelease
uses: "marvinpinto/action-automatic-releases@latest"
Expand Down

0 comments on commit 735f5ab

Please sign in to comment.